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

Re: Removing comma's from int (numbers)

by farang (Chaplain)
on Jun 13, 2013 at 07:30 UTC ( #1038698=note: print w/replies, xml ) Need Help??

in reply to Removing comma's from int (numbers)

The transliteration (tr) operator could also be used here to avoid the full overhead of regular expressions.

use strict; use warnings; my $grossAmt = "12,345,678.9"; $grossAmt =~ tr/,//d; $grossAmt = sprintf('%.2f', $grossAmt); print $grossAmt, $/; __END__ output: 12345678.90

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1038698]
[Discipulus]: ++erix
[Lady_Aleena]: Hello.
[Discipulus]: why github use 'pull request' instead of 'push request'? where is the subject?
[Discipulus]: I'm the subject or is the program? i think i always am the subject
[erix]: it an invite to pull, as I understand it
[Discipulus]: Concave or convex?
[Discipulus]: who make the invitation? the program?!?
[choroba]: it's historical
[erix]: pull requests
[choroba]: originally, you sent a pull request to someone by email, i.e. you asked them to pull from your repo

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (6)
As of 2017-05-27 20:08 GMT
Find Nodes?
    Voting Booth?