Sep 1, 2005 #1 wsexton Technical User Dec 4, 2001 49 0 0 US I'm trying to remove a comma from a negative number: First I use substr to get the number: $number = substr($line, 1, 10); Now $number has -1,125.50 I do this: $number =~ s/\,//g; This works for a positive number, but not negative. Any ideas?
I'm trying to remove a comma from a negative number: First I use substr to get the number: $number = substr($line, 1, 10); Now $number has -1,125.50 I do this: $number =~ s/\,//g; This works for a positive number, but not negative. Any ideas?
Sep 1, 2005 #2 mactonio Programmer Nov 18, 2003 55 0 0 US it worked for me, can you post what's in $line Upvote 0 Downvote
Sep 1, 2005 Thread starter #3 wsexton Technical User Dec 4, 2001 49 0 0 US I figured it out. Just a dumb mistake. Thanks anyways. Upvote 0 Downvote
Sep 1, 2005 #4 PaulTEG Technical User Sep 26, 2002 4,469 0 0 IE Can you post your fix, it might help others Spend an hour a week on CPAN, helps cure all known programming ailments ;-) Upvote 0 Downvote
Can you post your fix, it might help others Spend an hour a week on CPAN, helps cure all known programming ailments ;-)