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

Popular posts from this blog

authentication - Mongodb revoke acccess to connect test database -

r - Update two sets of radiobuttons reactively - shiny -

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -