Syntactic Confectionery Delight | |
PerlMonks |
Making money look niceby CodeJunkie (Monk) |
on Apr 11, 2003 at 23:35 UTC ( [id://249997]=perlquestion: print w/replies, xml ) | Need Help?? |
CodeJunkie has asked for the wisdom of the Perl Monks concerning the following question: Hi Monks, 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,
Back to
Seekers of Perl Wisdom
|
|