When I'm dividing,
echo 50.3228679581385 / 100;
Output:0.50322867958139
It should be 0.503228679581385
. Is there any way to avoid default round up?
When I'm dividing,
echo 50.3228679581385 / 100;
Output:0.50322867958139
It should be 0.503228679581385
. Is there any way to avoid default round up?
Yes, there's an INI setting for that, where 14 is the default value:
; The number of significant digits displayed in floating point numbers.
; http://php.net/precision
precision = 14
Increase to 15 or more, as necessary. Also works at runtime like this:
ini_set('precision', 15);