Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: How to Remove Commas ?

by roboticus (Chancellor)
on Mar 27, 2012 at 12:22 UTC ( #961912=note: print w/ replies, xml ) Need Help??


in reply to How to Remove Commas ?

allendevans:

I've not found a "search and replace" command to replace the commas with "nothing", allowing direct numeric manipulation of the scalar variables.

Really?

$ cat t.pl #/usr/bin/perl use strict; use warnings; use feature ':5.10'; my $t = "1,234,567.89"; $t =~ s/,//g; say $t; $ perl t.pl 1234567.89

...roboticus

When your only tool is a hammer, all problems look like your thumb.


Comment on Re: How to Remove Commas ?
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://961912]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (7)
As of 2015-08-02 17:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The oldest computer book still on my shelves (or on my digital media) is ...













    Results (7 votes), past polls