PHP 5.6.31 Released

Voting

Please answer this simple SPAM challenge: five plus three?
(Example: nine)

The Note You're Voting On

dastra
4 years ago
round() will sometimes return E notation when rounding a float when the amount is small enough - see  https://bugs.php.net/bug.php?id=44223 .  Apparently it's a feature.

To work around this "feature" when converting to a string, surround your round statement with an sprintf:

sprintf("%.10f", round( $amountToBeRounded, 10));

<< Back to user notes page

To Top