DateTime-Locale-FromCLDR
view release on metacpan or search on metacpan
my $ref = $locale->number_symbols;
my $ref = $locale->number_symbols( 'latn' );
# {
# approximately => "~",
# decimal => ".",
# exponential => "E",
# group => ",",
# infinity => "â",
# list => ";",
# minus => "-",
# nan => "NaN",
# per_mille => "â°",
# percent => "%",
# plus => "+",
# superscript => "\xD7",
# time_separator => ":",
# }
Returns an hash reference of a locale's number symbols.
If somehow, none were found, it returns an empty hash reference, so make
For example "-"
Note that, in the CLDR data, although it is always a visually
identical representation, the character itself used varies,
depending on the locale used. For example: "-" ("\x{2D}") vs "-"
("\x{D8}\x{9C}\x{2D}")
* "nan"
The NaN sign. Corresponds to the IEEE NaN bit pattern.
For example "NaN", "не ÑиÑло"
* "per_mille"
"Symbol used to indicate a per-mille (1/1000th) amount."
For example "â°", "Ø", "0/00"
* "percent"
"Symbol used to indicate a percentage (1/100th) amount."
my $ref = $locale->number_symbols;
my $ref = $locale->number_symbols( 'latn' );
# {
# approximately => "~",
# decimal => ".",
# exponential => "E",
# group => ",",
# infinity => "â",
# list => ";",
# minus => "-",
# nan => "NaN",
# per_mille => "â°",
# percent => "%",
# plus => "+",
# superscript => "\xD7",
# time_separator => ":",
# }
Returns an hash reference of a locale's number symbols.
If somehow, none were found, it returns an empty hash reference, so make sure to check for the size of the hash reference returned.
- `minus`
"Symbol used to denote negative value."
For example `-`
Note that, in the CLDR data, although it is always a visually identical representation, the character itself used varies, depending on the locale used. For example: `-` (`\x{2D}`) vs `-` (`\x{D8}\x{9C}\x{2D}`)
- `nan`
The NaN sign. Corresponds to the IEEE NaN bit pattern.
For example `NaN`, `не ÑиÑло`
- `per_mille`
"Symbol used to indicate a per-mille (1/1000th) amount."
For example `â°`, `Ø`, `0/00`
- `percent`
"Symbol used to indicate a percentage (1/100th) amount."
lib/DateTime/Locale/FromCLDR.pm view on Meta::CPAN
my $ref = $locale->number_symbols;
my $ref = $locale->number_symbols( 'latn' );
# {
# approximately => "~",
# decimal => ".",
# exponential => "E",
# group => ",",
# infinity => "â",
# list => ";",
# minus => "-",
# nan => "NaN",
# per_mille => "â°",
# percent => "%",
# plus => "+",
# superscript => "\xD7",
# time_separator => ":",
# }
Returns an hash reference of a locale's number symbols.
If somehow, none were found, it returns an empty hash reference, so make sure to check for the size of the hash reference returned.
lib/DateTime/Locale/FromCLDR.pm view on Meta::CPAN
=item * C<minus>
"Symbol used to denote negative value."
For example C<->
Note that, in the CLDR data, although it is always a visually identical representation, the character itself used varies, depending on the locale used. For example: C<-> (C<\x{2D}>) vs C<-> (C<\x{D8}\x{9C}\x{2D}>)
=item * C<nan>
The NaN sign. Corresponds to the IEEE NaN bit pattern.
For example C<NaN>, C<не ÑиÑло>
=item * C<per_mille>
"Symbol used to indicate a per-mille (1/1000th) amount."
For example C<â°>, C<Ø>, C<0/00>
=item * C<percent>
"Symbol used to indicate a percentage (1/100th) amount."
t/01.locale.t view on Meta::CPAN
native_variant => undef,
native_variants => [],
number_symbols => {
approximately => "~",
decimal => ".",
exponential => "E",
group => ",",
infinity => "â",
list => ";",
minus => "-",
nan => "NaN",
per_mille => "â°",
percent => "%",
plus => "+",
superscript => "Ã",
time_separator => ":",
},
number_system => q{latn},
number_systems => {
finance => undef,
native => "latn",
t/01.locale.t view on Meta::CPAN
native_variant => undef,
native_variants => [],
number_symbols => {
approximately => "~",
decimal => ".",
exponential => "E",
group => ",",
infinity => "â",
list => ";",
minus => "-",
nan => "NaN",
per_mille => "â°",
percent => "%",
plus => "+",
superscript => "Ã",
time_separator => ":",
},
number_system => q{latn},
number_systems => {
finance => undef,
native => "latn",
t/01.locale.t view on Meta::CPAN
native_variant => q{Valenciano},
native_variants => ["Valenciano"],
number_symbols => {
approximately => "~",
decimal => ",",
exponential => "E",
group => ".",
infinity => "â",
list => ";",
minus => "-",
nan => "NaN",
per_mille => "â°",
percent => "%",
plus => "+",
superscript => "Ã",
time_separator => ":",
},
number_system => q{latn},
number_systems => {
finance => undef,
native => "latn",
t/01.locale.t view on Meta::CPAN
native_variant => q{å½éé³å£°è¨å·},
native_variants => ["å½éé³å£°è¨å·", "ããã³å¼ãã¼ãå", ""],
number_symbols => {
approximately => "ç´",
decimal => ".",
exponential => "E",
group => ",",
infinity => "â",
list => ";",
minus => "-",
nan => "NaN",
per_mille => "â°",
percent => "%",
plus => "+",
superscript => "Ã",
time_separator => ":",
},
number_system => q{latn},
number_systems => {
finance => "jpanfin",
native => undef,
t/01.locale.t view on Meta::CPAN
is_deeply( $val->{ $k }, $def->{ $meth }->{ $k }, "${meth} -> ${k} -> '" . ( defined( $def->{ $meth }->{ $k } ) ? join( "', '", @{$def->{ $meth }->{ $k }} ) : 'undef' ) . "'" );
}
# NOTE: Floating point CLDR values such as territory_info -> literacy_percent
# The SQLite driver returns such values as native NVs, and on a perl built with
# -Duselongdouble or -Dusequadmath their stringification carries extra precision
# digits (for example '97.7000000000000028' instead of '97.7'). A plain string
# comparison would therefore fail even though the value is numerically correct, so
# genuine fractional numbers are compared numerically within a small tolerance, and
# every other value keeps an exact string comparison. We detect a fractional number
# with a strict decimal pattern rather than looks_like_number(), because the latter
# also accepts 'NaN', 'Inf' and 'Infinity', and the number_symbols hash legitimately
# contains a 'nan' symbol whose value is the string 'NaN'.
elsif( defined( $val->{ $k } ) &&
defined( $def->{ $meth }->{ $k } ) &&
$def->{ $meth }->{ $k } =~ /\A[+-]?[0-9]+\.[0-9]+\z/ )
{
my $got = $val->{ $k };
my $exp = $def->{ $meth }->{ $k };
ok( Scalar::Util::looks_like_number( $got ) && abs( $got - $exp ) < 1e-6, "${meth} -> ${k} -> '${exp}'" );
}
else
{
( run in 1.143 second using v1.01-cache-2.11-cpan-9581c071862 )