![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Confirmed User
Industry Role:
Join Date: Jun 2004
Location: New York, NY
Posts: 6,890
|
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:
__________________
Skype variuscr - Email varius AT gmail |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Confirmed User
Industry Role:
Join Date: Jun 2004
Location: New York, NY
Posts: 6,890
|
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:
__________________
Skype variuscr - Email varius AT gmail |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Confirmed User
Join Date: Jul 2003
Location: chicago
Posts: 1,135
|
use the force
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Confirmed User
Join Date: Nov 2004
Location: Scottsdale, AZ
Posts: 5,167
|
Try to add 1 to it
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Confirmed User
Industry Role:
Join Date: Jan 2002
Posts: 7,981
|
err......
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 | |
Confirmed User
Industry Role:
Join Date: Jun 2004
Location: New York, NY
Posts: 6,890
|
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..
__________________
Skype variuscr - Email varius AT gmail |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 | |
Confirmed User
Join Date: Nov 2004
Location: Scottsdale, AZ
Posts: 5,167
|
Quote:
![]() |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 |
Confirmed User
Join Date: Oct 2002
Location: chair
Posts: 135
|
You can use printf("%f", $var) or printf("%.5f", $var) instead of echo $var.
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 |
Confirmed User
Join Date: Jul 2004
Location: Denmark ICQ: 7880009
Posts: 2,203
|
PHP Code:
|
![]() |
![]() ![]() ![]() ![]() ![]() |