math - Converting very small numbers -
how can convert small numbers in lua? example 1.75245e-09 or 7.73411e-08 works e-04
from lua interpreter: 1> 1.75245e-05 1.75245e-05 1> 1.75245e-04 0.000175245
what want string.format works c print-into-string function sprintf
.
thus
string.format("%f",7.73411e-08)
should yield desired output. if useful have many leading zeros question. did not test this, default length might limited. if use
string.format("%20f",7.73411e-08)
to provide sufficient space.
Comments
Post a Comment