以下是我的代码
$number1 = "0.125";
$number2 = "0.05";
echo $total1 = round($number1,2);
echo $total2 = round($number2,2);
我得到的是输出
0.13 ---- output I want is : 13
0.05 ---- output I want is : 5
未获得所需的输出
答案 0 :(得分:0)
试试这个:
$number1 = "0.125";
$number2 = "0.05";
$total1 = round($number1,2) * 100;
$total2 = round($number2,2) * 100;
echo $total1 . "\n" .$total2;