Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Integer to Money format

by toolic (Chancellor)
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.


Comment on Re: Integer to Money format
Select or Download Code
Re^2: Integer to Money format
by tilly (Archbishop) on Jan 20, 2011 at 16:05 UTC

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (7)
As of 2014-08-20 21:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (124 votes), past polls