in reply to Making money look nice

perldoc -q comma

-derby

Replies are listed 'Best First'.
Re: Re: Making money look nice
by Anonymous Monk on Apr 12, 2003 at 08:48 UTC

    From "Mastering Regular Expressions 2nd Edn" p.65

    s/(?<=\d)(?=(\d\d\d)+$)/,/g

    I like this because you are actually using the regex to determine the location to insert the comma, as opposed to replacing any of the original string. HTH

Re: Re: Making money look nice
by Limbic~Region (Chancellor) on Apr 13, 2003 at 15:16 UTC
    derby,
    The only thing I would like to add is from the Perl FAQ. If you want to print money, then be sure to strip off the leading '$' (or appropriate symbol) before calling commify().

    Cheers - L~R