CLDR::Number::FAQ - FAQ for CLDR::Number
This document describes CLDR::Number v0.06, built with Unicode CLDR v24.
CLDR::Number is a stable project used in production by Shutterstock on www.shutterstock.com for formatting numbers, percents, and prices in twenty languages, ten currencies, and myriad countries.
The attributes minimum_fraction_digits and maximum_fraction_digits can be used. If you always want a specific number of fraction digits, also known as precision, set both of these attributes to the same number.
minimum_fraction_digits
maximum_fraction_digits
When displaying whole monetary numbers, it is sometimes desired to leave off the fraction digits (e.g. cents) for marketing purposes. To do this, set the maximum_fraction_digits attribute to 0. Beware though that some currencies have a number of fraction digits other than two, so it is not safe to set minimum_fraction_digits and maximum_fraction_digits to 2 for arbitrary currencies.
0
2
CLDR::Number::Format::Currency does not provide a default currency for the currency_code attribute like we have for the locale attribute nor does it provide a default_currency_code attribute like the default_locale attribute. This is because a price without a known currency has no known value. Setting a default currency is just as inaccurate as setting a default number. If your application depends on a default currency, the currency_code attribute can be explicitly set.
currency_code
locale
default_locale
“Note: Currency values should never be interchanged without a known currency code. You never want the number 3.5 interpreted as $3.5 by one user and ¥3.5 by another. Locale data contains localization information for currencies, not a currency value for a country. A currency amount logically consists of a numeric value, plus an accompanying currency code (or equivalent).” —Unicode Technical Standard #35
CLDR::Number::TODO
To install CLDR::Number, copy and paste the appropriate command in to your terminal.
cpanm
cpanm CLDR::Number
CPAN shell
perl -MCPAN -e shell install CLDR::Number
For more information on module installation, please visit the detailed CPAN module installation guide.