NAME
CLDR::Number::Format::Currency - Localized currency formatter using the Unicode CLDR
VERSION
This document describes CLDR::Number::Format::Currency v0.01, built with the Unicode CLDR v24. This is an early release without full documentation. 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)
DESCRIPTION
Localized currency formatter using the Unicode Common Locale Data Repository (CLDR).
Methods
- format
-
Accepts a number and returns a formatted currency value as a character string, using the currency from the
currency_codeattribute and localized with the currentlocale.
Attributes
All string attributes are expected to be character strings. 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:
3whenrootlocaleNot used when value is
0. - secondary_grouping_size
-
Default:
0whenrootlocaleNot used when value is
0. - 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 Shutterstock, Inc.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.