in reply to comparing two amounts of money.

You need to normalize the amounts before comparing them. Translate the input ($64,000 or $64,000.00 or $6400) to a standard number (6400) and then the comparison will work.

Replies are listed 'Best First'.
Re: Re: comparing two amounts of money.
by epaphus2 (Novice) on Dec 21, 2001 at 23:46 UTC
    Iam a newbie.. So how do i translate them to a standard number?
      The simplest, quickest, least-learning-anything no-fun way to do what you want, I think, is to add the following two lines of code immediately after you take input:
      $your_money_scalar =~ s/^\$//; $your_money_scalar =~ s/,//g;


      The first line removes a dollar sign at the beginning of a line.
      The second removes all commas.