NAME
CLDR::Number::Format::Currency - Localized currency formatter using the Unicode CLDR
VERSION
This document describes CLDR::Number v0.00_03, built with Unicode CLDR v24. This is a development release without full documentation and functionality may change. See CLDR::Number::TODO.
SYNOPSIS
# either
use CLDR::Number::Format::Currency;
my $curf = CLDR::Number::Format::Currency->new(
locale => 'en',
currency => 'USD',
);
# or
use CLDR::Number;
my $cldr = CLDR::Number->new(locale => 'en');
my $curf = $cldr->currency_formatter(currency_code => 'USD');
say $curf->format(9.99); # '$9.99' (English / USD)
$curf->locale('en-CA');
say $curf->format(9.99); # 'US$9.99' (Canadian English / USD)
$curf->locale('fr-CA');
say $curf->format(9.99); # '9,99 $US' (Canadian French / USD)
METHODS
- format
-
Accepts a number and returns a formatted currency value using the currency from the
currency_codeattribute and localized with the current locale.
ATTRIBUTES
See also the common attributes in CLDR::Number.
- currency_code
-
Default: not set
- currency_sign
-
Default: not set
- cash
-
Default: false (
0) - pattern
-
Default:
¤ #,##0.00whenrootlocale - minimum_integer_digits
-
Default:
1whenrootlocale - minimum_fraction_digits
-
Default:
2whenrootlocale - maximum_fraction_digits
-
Default:
2whenrootlocale - primary_grouping_size
-
Default:
3whenrootlocale - secondary_grouping_size
-
Default: not set when
rootlocale - rounding_increment
-
Default:
0whenrootlocale
SEE ALSO
AUTHOR
Nick Patch <patch@cpan.org>
This project is brought to you by Perl CLDR and Shutterstock. Additional open source projects from Shutterstock can be found at code.shutterstock.com.
COPYRIGHT AND LICENSE
© 2013 Nick Patch
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.