p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Perl (http://p2p.wrox.com/forumdisplay.php?f=196)
-   -   show numeric value as 102,34 (EURO money) (http://p2p.wrox.com/showthread.php?t=66984)

crmpicco March 28th, 2008 08:28 PM

show numeric value as 102,34 (EURO money)

# $moneytotal{$iso} is 102.34
sprintf("%.2f", $moneytotal{$iso})

is it possible to show the total as 102,34 as if it was in Europe, rather than 102.34 for UK

i'm not really able to change or set the Locale setting unfortunately....

What I am really looking for is having what would appear in the UK as £ 1,012.34 to be displayed as € 1.012,34 if a variable is EUR. This sort of thing.....


if ($curr eq "EUR") {
# code in here to display as 1.012,34

I don't think Math::Currency does the job - although I do have it installed, i've looked at the manual for it.

Any other suggestions?

Ayrshire Minis - a Mini E-Community

ciderpunx May 11th, 2008 07:05 AM

http://search.cpan.org/~tnguyen/Loca...1.25/Format.pm ?

Charlie Harvey's website - linux, perl, java, anarchism and punk rock: http://charlieharvey.org.uk

All times are GMT -4. The time now is 08:56 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.