The following amazoop code has an easy typo:

if($res == 0)
    $res = "0";
if($cents == 0)
    $cents == "00";

The last line, line #249,  should read "$cents = "00";"

Hope it helps. Thanks for Amazoop!