25 Oct
2009
25 Oct
'09
8:07 a.m.
Am 24.10.2009 um 18:59 schrieb batela:
Dear Sirs,
I'm looking a way to format float numbers. For example \ctxlua {text.print(sqrt(2))} give me 1.41421356237309504880 but i want 1.414.
Is there a way to format real numbers.
Note: I had tried \ctxlua{a = sqrt(a) ; aformat = string.format ("0.3%f", a) ; text.print(aformat)}
but that don't work because the % character
\ctxlua{text.sprint(string.format("0.3\%f",sqrt(2)))} or \ctxlua{text.sprint(string.format("0.3\letterpercent f",sqrt(2)))} Wolfgang