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 -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -