Quantcast
Viewing all articles
Browse latest Browse all 42

Answer by Ja͢ck for PHP - 8 decimals don't work

You can set the precision used when formatting floats as strings using the precision ini setting, the default being 14:

ini_set('precision', 16);echo $a - $b; // 1999999.99999999

Also, read this article for a more generic breakdown on the subject.


Viewing all articles
Browse latest Browse all 42

Trending Articles