我对计算的输出有疑问。我只是想除以数字,但结果不正确。
假设 $some_value = 1160.00,$another_value = 1360。
<?php
$money_earned = $some_value;
$cost_proposed = $another_value;
$money_percentage = (($money_earned / $cost_proposed) * 100);
?>
返回值为:0.073529411764706
但实际值应该是:85.29411764705882
为什么这给了我不正确的输出值?
编辑:这是我的真实代码:
$money_earned = calculate_cost($_GET['track']);
$cost_proposed = $res[0]['cost_proposed'];
$money_percentage = (($money_earned / $cost_proposed) * 100);