™.. Locale::Currency - Online Linux Manual PageSection : 3pm
Updated : 2009-02-12
Source : perl v5.10.1
Note : Perl Programmers Reference Guide

NAMELocale::Currency − ISO three letter codes for currency identification (ISO 4217)

SYNOPSIS​ use Locale::Currency; ​ ​ $curr = code2currency('usd'); # $curr gets 'US Dollar' ​ $code = currency2code('Euro'); # $code gets 'eur' ​ ​ @codes = all_currency_codes(); ​ @names = all_currency_names();

DESCRIPTIONThe \*(C`Locale::Currency\*(C'\fR module provides access to the \s-1ISO\s0 three-letter codes for identifying currencies and funds, as defined in ISO 4217. You can either access the codes via the conversion routines (described below), or with the two functions which return lists of all currency codes or all currency names. There are two special codes defined by the standard which aren't understood by this module: XTS Specifically reserved for testing purposes. XXX For transactions where no currency is involved.

CONVERSION ROUTINESThere are two conversion routines: \*(C`code2currency()\*(C'\fR and \f(CW\*(C`currency2code()\*(C'\fR. code2currency() This function takes a three letter currency code and returns a string which contains the name of the currency identified. If the code is not a valid currency code, as defined by ISO 4217, then \*(C`undef\*(C'\fR will be returned. ​ $curr = code2currency($code); currency2code() This function takes a currency name and returns the corresponding three letter currency code, if such exists. If the argument could not be identified as a currency name, then \*(C`undef\*(C'\fR will be returned. ​ $code = currency2code('French Franc'); The case of the currency name is not important. See the section KNOWN BUGS AND LIMITATIONS below.

QUERY ROUTINESThere are two function which can be used to obtain a list of all currency codes, or all currency names: all_currency_codes() Returns a list of all three-letter currency codes. The codes are guaranteed to be all lower-case, and not in any particular order. all_currency_names() Returns a list of all currency names for which there is a corresponding three-letter currency code. The names are capitalised, and not returned in any particular order.

EXAMPLESThe following example illustrates use of the \*(C`code2currency()\*(C'\fR function. The user is prompted for a currency code, and then told the corresponding currency name: ​ $| = 1; # turn off buffering ​ ​ print "Enter currency code: "; ​ chop($code = <STDIN>); ​ $curr = code2currency($code); ​ if (defined $curr){ ​ print "$code = $curr\n"; ​ } ​ else ​ { ​ print "'$code' is not a valid currency code!\n"; ​ }

KNOWN BUGS AND LIMITATIONS• In the current implementation, all data is read in when the module is loaded, and then held in memory. A lazy implementation would be more memory friendly. • This module also includes the special codes which are not for a currency, such as Gold, Platinum, etc. This might cause a problem if you're using this module to display a list of currencies. Let Neil know if this does cause a problem, and we can do something about it. • ISO 4217 also defines a numeric code for each currency. Currency codes are not currently supported by this module, in the same way Locale::Country supports multiple codesets. • There are three cases where there is more than one code for the same currency name. Kwacha has two codes: mwk for Malawi, and zmk for Zambia. The Russian Ruble has two codes: rub and rur. The Belarussian Ruble has two codes: byr and byb. The currency2code() function only returns one code, so you might not get back the code you expected.

SEE ALSOLocale::Country ISO codes for identification of country (ISO 3166). Locale::Script ISO codes for identification of written scripts (ISO 15924). ISO 4217:1995 Code for the representation of currencies and funds. http://www.bsi−global.com/iso4217currency Official web page for the ISO 4217 maintenance agency. This has the latest list of codes, in MS Word format. Boo.

AUTHORMichael Hennecke <hennecke@rz.uni−karlsruhe.de> and Neil Bowers <neil@bowers.com>

COPYRIGHTCopyright (C) 2002−2004, Neil Bowers. Copyright (c) 2001 Michael Hennecke and Canon Research Centre Europe (CRE). This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
0
Johanes Gumabo
Data Size   :   15,060 byte
man-Locale::Currency.3pmBuild   :   2024-12-05, 20:55   :  
Visitor Screen   :   x
Visitor Counter ( page / site )   :   3 / 177,781
Visitor ID   :     :  
Visitor IP   :   3.147.51.72   :  
Visitor Provider   :   AMAZON-02   :  
Provider Position ( lat x lon )   :   39.962500 x -83.006100   :   x
Provider Accuracy Radius ( km )   :   1000   :  
Provider City   :   Columbus   :  
Provider Province   :   Ohio ,   :   ,
Provider Country   :   United States   :  
Provider Continent   :   North America   :  
Visitor Recorder   :   Version   :  
Visitor Recorder   :   Library   :  
Online Linux Manual Page   :   Version   :   Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.05
Online Linux Manual Page   :   Library   :   lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page   :   Library   :   lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base   :   Version   :   Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base   :   Library   :   lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36

Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.

ERROR : Need New Coding :         (parse_manual_page_|249|Locale::Currency.3pm|36/37|el══─{─══.|.el══─{─══. ds -- \|\(em\| )         (htmlprn|149|Locale::Currency.3pm|36/37|.el══─{─══. ds --  —  |.el══─{─══. ds -- \|\(em\| )         (parse_manual_page_|249|Locale::Currency.3pm|41|br══─}─══|'br══─}─══ )         (htmlprn|149|Locale::Currency.3pm|41|'br══─}─══ |'br══─}─══ )         (rof_nr_x|149|Locale::Currency.3pm|51/52|\nF|.ie \nF ══─{─══. de IX )         (rof_unit_scale_px|41|Locale::Currency.3pm|51/52|F|.ie \nF ══─{─══. de IX )         (rof_if|19|Locale::Currency.3pm|51/52|\nF|.ie \nF ══─{─══. de IX )         (htmlprn|149|Locale::Currency.3pm|51/52|.ie \nF ══─{─══. de IX|.ie \nF ══─{─══. de IX )         (rof_escape_sequence|91|Locale::Currency.3pm|53|\$1\t\\n%\t"\\$2" |. tm Index:\\$1\t\\n%\t"\\$2" )         (parse_manual_page_|249|Locale::Currency.3pm|57|══─}─══|.══─}─══ )         (htmlprn|149|Locale::Currency.3pm|57|.══─}─══ |.══─}─══ )         (rof_escape_sequence|91|Locale::Currency.3pm|147|\*(C`Locale::Currency\*(C'\fR module provides access to the \s-1ISO\s0 three-letter |The \f(CW\*(C`Locale::Currency\*(C'\fR module provides access to the \s-1ISO\s0 three-letter )         (rof_escape_sequence|91|Locale::Currency.3pm|164|\*(C`code2currency()\*(C'\fR and \f(CW\*(C`currency2code()\*(C'\fR. |There are two conversion routines: \f(CW\*(C`code2currency()\*(C'\fR and \f(CW\*(C`currency2code()\*(C'\fR. )         (rof_escape_sequence|91|Locale::Currency.3pm|169|\*(C`undef\*(C'\fR |not a valid currency code, as defined by \s-1ISO\s0 4217, then \f(CW\*(C`undef\*(C'\fR )         (rof_escape_sequence|91|Locale::Currency.3pm|180|\*(C`undef\*(C'\fR will be returned. |then \f(CW\*(C`undef\*(C'\fR will be returned. )         (rof_escape_sequence|91|Locale::Currency.3pm|206|\*(C`code2currency()\*(C'\fR function. |The following example illustrates use of the \f(CW\*(C`code2currency()\*(C'\fR function. )