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

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -