PHP - Round more than 14 decimal places
871
Is it possible to round more than 14 decimal places?
If I do:
echo round(1/3, 4); // equals .3333
echo round(1/3, 14); // equals .33333333333333
echo round(1/3, 20); // equals .33333333333333
Is it possible to get 20 decimal places in PHP for absolute precision?
Answer
Solution:
For lots of decimal places, you'd better use BC Math rather than trying to force PHP to do it.
You can change the precision ini setting, but you won't get the results you're expecting.
Answer
Solution:
You can also use the decimal extension with a reasonably high precision like 28, which then supports up to 28 significant digits.