2017-04-19 16:04 GMT+02:00 Otared Kavian :
>
> \starttext
> \ctxlua{x = math.floor(10^3*math.pi)/10^3; context(x)}
> \stoptext
>
Hi Kavian (or Otared ?),
Thank you very much, it works.
Fabrice
Hi Fabrice,
You can use a construction such as:
\starttext
\ctxlua{x = math.floor(10^3*math.pi)/10^3; context(x)}
\stoptext
Best regards: OK
> On 19 Apr 2017, at 15:25, Fabrice Couvreur
> wrote:
>
> Hello,
> I do not know Lua but I'll learn later. How to display
Am 19.04.2017 um 15:25 schrieb Fabrice Couvreur:
I do not know Lua but I'll learn later. How to display only 3 digits
after the decimal point ?
The default is 3 digits
\startluacode
function round(a,dec)
local dec = dec or 3
local b = math.pow(10,dec)
return math.floor(a*b)/b
end
Hello,
do you mean this? - It shows EXACTLY 3 digits after the decimal point:
\cldcontext{string.format("\letterpercent.3f", 5.8/1.6)}
\cldcontext{string.format(string.char(37) .. ".3f", 5.8/1.6)}
\startluacode
context(string.format("%.3f", 5.8/1.6))
\stopluacode
Best regards,
On Wed, 19 Apr 2017, Procházka Lukáš Ing. wrote:
Hello,
do you mean this? - It shows EXACTLY 3 digits after the decimal point:
\cldcontext{string.format("\letterpercent.3f", 5.8/1.6)}
\cldcontext{string.format(string.char(37) .. ".3f", 5.8/1.6)}
\startluacode
Hello,
I do not know Lua but I'll learn later. How to display only 3 digits after
the decimal point ?
thank you,
Fabrice
\starttext
\startlinecorrection[blank]
\startmidaligned
\bTABLE[width=2cm,offset=0.8ex,align={lohi,middle}]
\bTR
\bTD \math{P} \eTD
\bTD
Hello Henri,
I tried to use labeltexts without success so far. Here is the simple
example I tried to do :
\setuplabeltext [East=east, West=west]
\setuplabeltext [en] [Name=name]
\setuplabeltext [fr] [Name=nom]
\starttext
\labeltext{East} % Works
\labeltext{West} % Works
On 04/20/2017 07:08 AM, Jonas Baggett wrote:
> Hello Henri,
>
> I tried to use labeltexts without success so far. Here is the simple
> example I tried to do :
>
>\setuplabeltext [East=east, West=west]
>\setuplabeltext [en] [Name=name]
>\setuplabeltext [fr] [Name=nom]
>
>