PHP 8.5.0 RC 2 available for testing

Voting

: min(three, one)?
(Example: nine)

The Note You're Voting On

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