PHP 8.4.24 Released!

Voting

: max(two, six)?
(Example: nine)

The Note You're Voting On

dastra
14 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