PHP数字加法错误
我想对数字1.000000+0或1.000000+1.000000进行汇总,但是当我进行收集时,我得到了上面的结果。我哪里做错了?我解决了这个问题。这对打电话的人很有帮助PHP数字加法错误,php,Php,我想对数字1.000000+0或1.000000+1.000000进行汇总,但是当我进行收集时,我得到了上面的结果。我哪里做错了?我解决了这个问题。这对打电话的人很有帮助 $score = $_GET['score']; $ht = $ayarcek['total']; $total = $ht+$score; echo $total; Result: 6.0E-8 你的号码没有“错”。这就是所谓的科学记数法,是一种表示大小数字的方法。 $score = $_GET['score']; $h
$score = $_GET['score'];
$ht = $ayarcek['total'];
$total = $ht+$score;
echo $total;
Result: 6.0E-8
你的号码没有“错”。这就是所谓的科学记数法,是一种表示大小数字的方法。
$score = $_GET['score'];
$ht = $ayarcek['total'];
$cek = $ht+$score;
$total = sprintf('%.8f', $cek);