Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: (Golf) Formatting Integer To Money

by Aristotle (Chancellor)
on Aug 29, 2002 at 17:53 UTC ( [id://193840]=note: print w/replies, xml ) Need Help??


in reply to (Golf) Formatting NumberTo Money

53
# 1 2 3 4 5 #2345678901234567890123456789012345678901234567890123 $_=sprintf"%.2f",pop;{s/(^\d+)(\d{3})/$1,$2/&&redo}$_

Makeshifts last the longest.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2024-09-09 05:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.