Odd math behavior?

kc8oye

New member
i have this code
Code:
if ($debug) {
    echo "Labor Amt: $lbrAmt<br> PArts total: $pTotal <br> Pay Total: $payTotal<br>\r\n";
}   
    $invBal = ($lbrAmt + $pTotal) - $payTotal;
    ?>
    <table><tr><th>Labor: </th><td><?=$lbrAmt?></td></tr>
    <tr><th>Parts:</th><td><?=$pTotal?></td></tr>
    <tr><th>Payments:</th><td><?=$payTotal?></td></tr>
    <tr><th>Balance:</th><td><?=$invBal?></td></tr></table>

that produces this output

Labor Amt: 96.25
PArts total: 109.08
Pay Total: 205.33
Labor:96.25
Parts:109.08
Payments:205.33
Balance:-2.8421709430404E-14


why is simple 2 decimal place math generating an answer of 0.0000000000002 ?
 
Back
Top