var uc = 2.10;
var dort_bucuk = 1.80;
islem = parseFloat(uc-dort_bucuk);
alert(islem) // 0.30000000000000004
var uc = 1.10;
var dort_bucuk = 0.95;
islem = parseFloat(uc-dort_bucuk);
alert(islem) // 0.15000000000000013
var uc = 4.00;
var dort_bucuk = 3.70;
islem = parseFloat(uc-dort_bucuk);
alert(islem)//0.2999999999999998
我如何使用php number_format($ int,2) 为什么它即将到来4.00-3.70 = 0.2999999999999998?它必须
<?php
$bir = 4.00;
$iki = 3.70;
echo number_format($bir-$iki,2); // 0.30
?>
感谢您的帮助
答案 0 :(得分:0)