APM: Currency Formatting

HCoyote hcoyote at ghostar.ath.cx
Mon Oct 10 17:34:35 PDT 2005


On Mon, Oct 10, 2005 at 09:52:51AM -0500, David Bluestein II wrote:
> Okay, I've got currency (some $00000.00, some 0000.00, some 000.0) that 
> I need to run through a formatter and get out:
> 
> $00,000.00
> 
> I have the cents, and the $ sign, but is there an easy way to get 
> commas from sprint which is generating my decimal places? Or do I need 
> to use something more like the Format.pm? I looked in cookbook, and it 
> does commas based on straight numbers, not with decimals. Anyone have 
> an elegant solution, since the ones I googled were not.

You probably want one of:

  Locale::Currency::Format
  Number::Format
  Math::Currency

all of which look like they have the formatting you want.

Travis



More information about the Austin mailing list