develooper Front page | perl.beginners | Postings from October 2009

Re: printf with currency symbols

Thread Previous | Thread Next
Bryan R Harris
October 26, 2009 11:53
Re: printf with currency symbols
Message ID:

> Robert Citek wrote:
>> Not sure if there is a better way.  My guess is that there is probably
>> some module to convert float to currency and then print it as a
>> string.  But a quick Google didn't turn up anything.
> Here' why (extracted from `perldoc perllocale`):
>    Category LC_MONETARY: Formatting of monetary amounts
>        The C standard defines the "LC_MONETARY" category, but no
> function that is affected by its contents.  (Those with experience of
> standards committees will recognize that the working group decided to
> punt on the issue.)  Consequently, Perl takes no notice of it.  If you
> really want to use "LC_MONETARY", you can query its contents--see "The
> localeconv function"--and use the information that it returns in your
> applicationĀ¹s own formatting of currency amounts.  However, you may well
> find that the information, voluminous and complex though it may be,
> still does not quite meet your requirements: currency formatting is a
> hard nut to crack.

That's what I needed to know -- thanks Shawn (and Jim and Robert).

- Bryan

Bryan Harris
Sr. Systems Engineer II
Huntsville Operations Analysis & System Performance
Missile Systems, Raytheon Company

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About