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: Beginner:
Conversion Newbie Needs Help

 



centrux
Deleted

Jun 8, 2000, 7:47 AM

Post #1 of 5 (672 views)
Conversion Newbie Needs Help Can't Post

Hi Everybody,

This is a newbie question and hope somebody will reply to this, I am trying
to convert the currency into a just plain numbers using perl but I wasn't
able to. If anyone know please.... your help will be highly appreciated...

Ex. $12,345.67

Needs to remove the $, comma(,), and decimal places(.) = 1234567

Thanks,



monocle
User

Jun 8, 2000, 7:54 AM

Post #2 of 5 (672 views)
Re: Conversion Newbie Needs Help [In reply to] Can't Post

try

$currency =~ s/\$//; #replaces $ with nothing
$currency =~ s/\,//; #replaces , with nothing
$currency =~ s/\.//; #replaces . with nothing

Monocle
Hear great techno music by Monocle at http://www.mp3.com/monocle


centrux
Deleted

Jun 8, 2000, 8:07 AM

Post #3 of 5 (672 views)
Re: Conversion Newbie Needs Help [In reply to] Can't Post

thanks....


dws
Deleted

Jun 8, 2000, 8:59 AM

Post #4 of 5 (672 views)
Re: Conversion Newbie Needs Help [In reply to] Can't Post

$current =~ s/[\$,.]//g;

does all three replacements.




monocle
User

Jun 8, 2000, 9:10 AM

Post #5 of 5 (672 views)
Re: Conversion Newbie Needs Help [In reply to] Can't Post

cool. thanks for that tid bit.

monocle

 
 


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

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