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

Re: printf with currency symbols

Thread Previous | Thread Next
From:
Bryan R Harris
Date:
October 26, 2009 11:53
Subject:
Re: printf with currency symbols
Message ID:
C70B5A4A.37586%Bryan_R_Harris@raytheon.com

> 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
bh@raytheon.com
256.542.4632




Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About