my $p = &PricePerUnit(..); $units = int(0.5 + ($units*$p*100) )/100;