2 # Locale::Currency - ISO three letter codes for currency identification
5 # $Id: Currency.pm,v 2.2 2002/07/10 16:33:27 neilb Exp $
8 package Locale::Currency;
14 #-----------------------------------------------------------------------
15 # Public Global Variables
16 #-----------------------------------------------------------------------
17 use vars qw($VERSION @ISA @EXPORT);
18 $VERSION = sprintf("%d.%02d", q$Revision: 2.2 $ =~ /(\d+)\.(\d+)/);
20 @EXPORT = qw(&code2currency ¤cy2code
21 &all_currency_codes &all_currency_names );
23 #-----------------------------------------------------------------------
24 # Private Global Variables
25 #-----------------------------------------------------------------------
30 #=======================================================================
32 # code2currency( CODE )
34 #=======================================================================
40 return undef unless defined $code;
42 if (exists $CODES{$code})
48 #---------------------------------------------------------------
49 # no such currency code!
50 #---------------------------------------------------------------
56 #=======================================================================
58 # currency2code ( CURRENCY )
60 #=======================================================================
66 return undef unless defined $curr;
68 if (exists $CURRENCIES{$curr})
70 return $CURRENCIES{$curr};
74 #---------------------------------------------------------------
76 #---------------------------------------------------------------
82 #=======================================================================
84 # all_currency_codes()
86 #=======================================================================
87 sub all_currency_codes
93 #=======================================================================
95 # all_currency_names()
97 #=======================================================================
98 sub all_currency_names
100 return values %CODES;
104 #=======================================================================
105 # initialisation code - stuff the DATA into the CODES hash
106 #=======================================================================
116 ($code, $currency) = split(/:/, $_, 2);
117 $CODES{$code} = $currency;
118 $CURRENCIES{"\L$currency"} = $code;
132 ang:Netherlands Antillean Guilder
135 aor:Kwanza Reajustado
138 aud:Australian Dollar
140 azm:Azerbaijanian Manat
142 bam:Convertible Marks
159 byb:Belarussian Ruble
160 byr:Belarussian Ruble
166 clf:Unidades de Formento
170 crc:Costa Rican Colon
172 cve:Cape Verde Escudo
183 ecv:Unidad de Valor Constante (UVC)
193 fkp:Falkland Islands Pound
204 gwp:Guinea-Bissau Peso
233 kyd:Cayman Islands Dollar
258 mxn:Mexican Nuevo Peso
259 myr:Malaysian Ringgit
265 nlg:Netherlands Guilder
268 nzd:New Zealand Dollar
278 pte:Portuguese Escudo
289 sbd:Solomon Islands Dollar
301 svc:El Salvador Colon
312 ttd:Trinidad and Tobago Dollar
313 twd:New Taiwan Dollar
314 tzs:Tanzanian Shilling
320 usn:US Dollar (Next day)
321 uss:US Dollar (Same day)
334 xba:European Composite Unit
335 xbb:European Monetary Unit
336 xbc:European Unit of Account 9
337 xb5:European Unit of Account 17
338 xcd:East Caribbean Dollar
340 xeu:ECU (until 1998-12-31)