Desert coderif (is_greater_than($ARGV[0],$ARGV[1])) { print "TRUE"; } else { print "FALSE"; } sub is_greater_than { my ($a,$b) = @_; return (to_num($a) > to_num($b)); } sub to_num { my $val = shift; $val =~ s/[\$,]//g; return ($val * 100); }
In reply to Re: comparing two amounts of money.
by JojoLinkyBob
in thread comparing two amounts of money.
by epaphus2
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |