Adding to NetWallah's suggestion, perl (the interpreter) 'sees' the numeric value of $price as -1.5, not the -1.500 you've scripted:
perl -MO=Deparse,-p -e 'my $price = -1.500;' (my $price = (-1.5)); -e syntax OK
In reply to Re: regex to match numbers after decimal
by Kenosis
in thread regex to match numbers after decimal
by doubledecker
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |