CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
Removing a comma

 



yim11
Novice

Oct 26, 2000, 4:31 PM

Post #1 of 2 (282 views)
Removing a comma Can't Post

Hello,
I have a script that calcualtes how much time a workers makes while on break. The user enters their salary and amount of time on break and the script tell them how much they made while on break.
Well, I recently learned that if the user uses a comma when entering their salary the scripts wont calculate correctly.

My question is how can I remove that comma so the scripts functions as its supposed to.

TIA,
-Jim


perlkid
stranger

Oct 26, 2000, 6:13 PM

Post #2 of 2 (282 views)
Re: Removing a comma [In reply to] Can't Post

 
$salary =~ tr/,//;

Or

$salary =~ s/,//g;

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives