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

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to