in reply to for loop with float
This makes sure you get exactly two numbers after the point. If I don't want to round the number I still add a small fractional number instead of 0.5, so that I don't get 5.99 if it really should be 6.00$i= int($i*100+.5)/100;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: for loop with float
by BrowserUk (Patriarch) on Jul 25, 2008 at 00:38 UTC | |
by jethro (Monsignor) on Jul 25, 2008 at 03:31 UTC |