Quantcast
Channel: User Ja͢ck - Stack Overflow
Viewing all articles
Browse latest Browse all 44

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

$
0
0

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 44

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>