PHP: rounding a number into 16 decimal digits
问题 Hi I'm trying to rounding a number into the 16 decimal digits but it only show and doesn't round up till 14 decimal digit . Here's my attempt: <?php $num= 0.16346153846153846; $round = number_format((float)$num, 17, '.', ''); echo $round * -1; ?> OUTPUT: -0.16346153846154 EXPECTED OUTPUT: 0.1634615384615385 I know that float is only 14 decimal digits. Is there any other way around for the 16 decimal digits ? 回答1: You can set this parameters at run-time. 16 digits is usually the maximum value