CodeJunkie has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks,
Can anyone help me make my money look nice!?
I have a value of, say £195000. This is ugly looking and I want to put commas in it to make it more readable. I.e. £195,000.
Now I can do this fine if I know how long the number is, i.e. do some kind of substitution based on \d{3} but what if I don't know how long the number is?
I guess I would have to count the number of digits to work out the number of commas, then count in 3's from the right, adding commas where appropriate.
Anyway, I thought maybe someone could just tell me there is a cool little module that does this for me, or perhaps give me a clue what the substitution would look like?
Thanks for any help,
Cheers,
Tom
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Making money look nice
by valdez (Monsignor) on Apr 12, 2003 at 10:00 UTC | |
|
Re: Making money look nice
by The Mad Hatter (Priest) on Apr 12, 2003 at 00:15 UTC | |
by TGI (Parson) on Apr 12, 2003 at 00:34 UTC | |
|
Re: Making money look nice
by derby (Abbot) on Apr 11, 2003 at 23:42 UTC | |
by Anonymous Monk on Apr 12, 2003 at 08:48 UTC | |
by Limbic~Region (Chancellor) on Apr 13, 2003 at 15:16 UTC | |
|
Re: Making money look nice
by pg (Canon) on Apr 12, 2003 at 01:35 UTC | |
|
Re: Making money look nice
by benn (Vicar) on Apr 12, 2003 at 11:31 UTC | |
|
Re: Making money look nice
by Anonymous Monk on Apr 12, 2003 at 04:20 UTC | |
|
Re: Making money look nice
by Anonymous Monk on Apr 11, 2003 at 23:42 UTC | |
by Anonymous Monk on Apr 11, 2003 at 23:44 UTC | |
|
Re: Making money look nice
by reclaw (Curate) on Apr 12, 2003 at 22:04 UTC |