NAME
CLDR::Number::Format::Percent - Localized percent 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::Percent;
my $perf = CLDR::Number::Format::Percent->new(locale => 'eu');
# or
use CLDR::Number;
my $cldr = CLDR::Number->new(locale => 'tr');
my $perf = $cldr->percent_formatter;
say $perf->format(0.05); # '%5' (Basque percent)
$perf->locale('es');
say $perf->format(0.05); # '5 %' (French percent)
$perf->permil(1);
say $perf->format(0.05); # '50 ‰' (French per mil)
METHODS
- format
-
Accepts a number and returns a formatted percent, localized with the current locale. If the
permilattribute is true, returns per mil instead of percent.
ATTRIBUTES
See also the common attributes in CLDR::Number.
- permil
-
Default: false (
0) - percent_sign
-
Default:
%whenrootlocale - permil_sign
-
Default:
‰whenrootlocale - pattern
-
Default:
#,##0%whenrootlocale - minimum_integer_digits
-
Default:
1whenrootlocale - minimum_fraction_digits
-
Default:
0whenrootlocale - maximum_fraction_digits
-
Default:
0whenrootlocale - primary_grouping_size
-
Default:
3whenrootlocale - secondary_grouping_size
-
Default: not set when
rootlocale - rounding_increment
-
Default:
0whenrootlocale
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.