use strict; use warnings; my $payment_total = 415; my $order_total = 420; my $difference = $order_total - $payment_total; print cash($difference); sub cash { $_[0] = int($_[0] + .5); $_[0] /= 100 if $_[0] != 0; return sprintf('$%.2f', $_[0]) }
In reply to Re: numeric values acting funny
by TedPride
in thread numeric values acting funny
by jdts
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |