in reply to Re: (Golf) Formatting Integer To Money
in thread (Golf) Formatting NumberTo Money
update: I am a little confused about the input, the post asks for an integer, which would not have any decimal places, but some of the input has a decimal place..sub a{$_=pop;{s/(\d)(\d{3})(?!\d)/$1,$2/&&redo}$_.'.00'}
perl -e '$_=$0;split??;chop$_;$;=pop@_;$;++for(0..9060420);$_.=reverse +$;;print'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: (Golf) Formatting Integer To Money
by enoch (Chaplain) on Aug 29, 2002 at 17:41 UTC |