diff options
Diffstat (limited to 'Master/tlpkg/tlperl/lib/Locale/Currency.pod')
-rw-r--r-- | Master/tlpkg/tlperl/lib/Locale/Currency.pod | 168 |
1 files changed, 48 insertions, 120 deletions
diff --git a/Master/tlpkg/tlperl/lib/Locale/Currency.pod b/Master/tlpkg/tlperl/lib/Locale/Currency.pod index dce32612949..25512b85603 100644 --- a/Master/tlpkg/tlperl/lib/Locale/Currency.pod +++ b/Master/tlpkg/tlperl/lib/Locale/Currency.pod @@ -1,7 +1,8 @@ +=pod =head1 NAME -Locale::Currency - ISO three letter codes for currency identification (ISO 4217) +Locale::Currency - standard codes for currency identification =head1 SYNOPSIS @@ -16,135 +17,72 @@ Locale::Currency - ISO three letter codes for currency identification (ISO 4217) =head1 DESCRIPTION -The C<Locale::Currency> module provides access to the ISO three-letter -codes for identifying currencies and funds, as defined in ISO 4217. -You can either access the codes via the L<conversion routines> -(described below), -or with the two functions which return lists of all currency codes or -all currency names. +The C<Locale::Currency> module provides access to standard codes used +for identifying currencies and funds, such as those defined in ISO 4217. -There are two special codes defined by the standard which aren't -understood by this module: +Most of the routines take an optional additional argument which +specifies the code set to use. If not specified, the default ISO +4217 three-letter codes will be used. -=over 4 - -=item XTS - -Specifically reserved for testing purposes. - -=item XXX - -For transactions where no currency is involved. - -=back +=head1 SUPPORTED CODE SETS - -=head1 CONVERSION ROUTINES - -There are two conversion routines: C<code2currency()> and C<currency2code()>. +There are several different code sets you can use for identifying +currencies. The ones currently supported are: =over 4 -=item code2currency() +=item B<alpha> -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> -will be returned. +This is a set of three-letter (uppercase) codes from ISO 4217 such +as EUR for Euro. - $curr = code2currency($code); +Two of the codes specified by the standard (XTS which is reserved +for testing purposes and XXX which is for transactions where no +currency is involved) are omitted. -=item currency2code() +This code set is identified with the symbol C<LOCALE_CURR_ALPHA>. -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> will be returned. +This is the default code set. - $code = currency2code('French Franc'); +=item B<num> -The case of the currency name is not important. -See the section L<KNOWN BUGS AND LIMITATIONS> below. - -=back +This is the set of three-digit numeric codes from ISO 4217. +This code set is identified with the symbol C<LOCALE_CURR_NUMERIC>. -=head1 QUERY ROUTINES +=back -There are two function which can be used to obtain a list of all -currency codes, or all currency names: +=head1 ROUTINES =over 4 -=item C<all_currency_codes()> +=item B<code2currency ( CODE [,CODESET] )> -Returns a list of all three-letter currency codes. -The codes are guaranteed to be all lower-case, -and not in any particular order. +=item B<currency2code ( NAME [,CODESET] )> -=item C<all_currency_names()> +=item B<currency_code2code ( CODE ,CODESET ,CODESET2 )> -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. +=item B<all_currency_codes ( [CODESET] )> -=back +=item B<all_currency_names ( [CODESET] )> +=item B<Locale::Currency::rename_currency ( CODE ,NEW_NAME [,CODESET] )> -=head1 EXAMPLES +=item B<Locale::Currency::add_currency ( CODE ,NAME [,CODESET] )> -The following example illustrates use of the C<code2currency()> function. -The user is prompted for a currency code, and then told the corresponding -currency name: +=item B<Locale::Currency::delete_currency ( CODE [,CODESET] )> - $| = 1; # turn off buffering +=item B<Locale::Currency::add_currency_alias ( NAME ,NEW_NAME )> - 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"; - } +=item B<Locale::Currency::delete_currency_alias ( NAME )> -=head1 KNOWN BUGS AND LIMITATIONS +=item B<Locale::Currency::rename_currency_code ( CODE ,NEW_CODE [,CODESET] )> -=over 4 +=item B<Locale::Currency::add_currency_code_alias ( CODE ,NEW_CODE [,CODESET] )> -=item * +=item B<Locale::Currency::delete_currency_code_alias ( CODE [,CODESET] )> -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. - -=item * - -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. - -=item * - -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. - -=item * - -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. +These routines are all documented in the Locale::Codes man page. =back @@ -152,40 +90,30 @@ you might not get back the code you expected. =over 4 -=item Locale::Country - -ISO codes for identification of country (ISO 3166). +=item B<Locale::Codes> -=item Locale::Script +=item B<Locale::Constants> -ISO codes for identification of written scripts (ISO 15924). +=item B<http://www.iso.org/iso/support/currency_codes_list-1.htm> -=item ISO 4217:1995 - -Code for the representation of currencies and funds. - -=item 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. +The ISO 4217 data. =back =head1 AUTHOR -Michael Hennecke E<lt>hennecke@rz.uni-karlsruhe.deE<gt> -and -Neil Bowers E<lt>neil@bowers.comE<gt> +See Locale::Codes for full author history. -=head1 COPYRIGHT +Currently maintained by Sullivan Beck (sbeck@cpan.org). -Copyright (C) 2002-2004, Neil Bowers. +=head1 COPYRIGHT -Copyright (c) 2001 Michael Hennecke and -Canon Research Centre Europe (CRE). + Copyright (c) 1997-2001 Canon Research Centre Europe (CRE). + Copyright (c) 2001 Michael Hennecke + Copyright (c) 2001-2010 Neil Bowers + Copyright (c) 2010-2011 Sullivan Beck This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut - |