Show more digits in PHP
问题 Let's say I have: echo 1/3; And it print out only 0.33333333333333, can I get more digits? 回答1: Can use bcdiv echo bcdiv(1, 3, 20); The third argument is used to set the number of digits after the decimal place in the result. You can also set the global default scale for all functions by using bcscale(). 回答2: Edit the precision configuration variable either in your php.ini or some other configuration location or use ini_set(). ini_set('precision', 22); echo 1/3; // 0.3333333333333333148296