Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re: Integer to Money format

by toolic (Bishop)
on Jan 20, 2011 at 13:45 UTC ( #883316=note: print w/replies, xml ) Need Help??

in reply to Integer to Money format

Whenever I see "format" and "number", I think of... Number::Format :)
use warnings; use strict; use Number::Format qw(format_picture); print format_picture(4123456789, '##,##,##,##,##,##,###'), "\n"; __END__ 4,12,34,56,789
You could consider this as an alternative to regular expressions. One disadvantage is that format_picture forces you to know the upper bound on your number's length.

Replies are listed 'Best First'.
Re^2: Integer to Money format
by tilly (Archbishop) on Jan 20, 2011 at 16:05 UTC

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://883316]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2017-06-27 01:13 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (595 votes). Check out past polls.