私は1つのカウンターを作成し、PHPを使用しており、ほとんどすべてが正常に機能していましたが、小さなバグが1つ見つかりました。
カウンターでの最初の2つのステップは、順調に進んでい$bid
ます$stax
。
私の最後の結果$pay
は次のようになります:8138 + 814 + 448 = 9400
しかしそれは私に与えています$9,399
私の出力は次のとおりです。
Value $8,138 bid $814 tax $448 You Pay $9,399
Value $8,952 bid $895 tax $492 You Pay $10,339
Value $9,847 bid $985 tax $542 You Pay $11,373
これが私のphpです
<?php
$i = 0;
$v = 8138; // value : 8138
do {
$i++;
$bid = $v / 10; // output : $814
$ftax = $v + $bid;
$stax = $ftax / 20; // output : tax $448
$pay = $v + $bid + $stax; // 8138 + 814 + 448 = 9400
echo "Value $" . number_format($v) . " bid $" . number_format($bid) . " tax $" . number_format($stax) . " You Pay $" . number_format($pay) . "<br />";
$v = $v * 1.1;
} while ($i <= 2);
?>
前もって感謝します :)