![]() |
PHP: How do you convert from EXPONENT_DNUM to LNUM format??
I'm having a very annoying problem this morning....
If I increment a variable by small floats (like 0.00001 lets say) in a loop, the vairable becomes EXPONENT_DNUM format. I would like to keep it in LNUM format. Any ideas? I've made a simple loop here to show an example: PHP Code:
|
I do have one way to make it work, but I'd prefer finding out the true method...my way is just a workaround :)
I replace the last line by this instead, and then it works: PHP Code:
|
use the force
|
Try to add 1 to it
|
err......
|
Quote:
The weird part is, if I only add a value once, its fine. ie. PHP Code:
Once I loop on it though and add more values, it changes format. Weird, no one on IRC or google could solve it...my fix above though works for my purposes.. |
Quote:
|
You can use printf("%f", $var) or printf("%.5f", $var) instead of echo $var.
|
PHP Code:
|
All times are GMT -7. The time now is 06:22 PM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123