<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">NAME

    CLDR::Number - Localized number formatters using the Unicode CLDR

VERSION

    This document describes CLDR::Number v0.11, built with Unicode CLDR
    v27.0.1.

SYNOPSIS

        use CLDR::Number;
    
        # new oject with 'es' (Spanish) locale
        $cldr = CLDR::Number-&gt;new(locale =&gt; 'es');
    
        # decimals
        $decf = $cldr-&gt;decimal_formatter;
    
        # when locale is 'es' (Spanish)
        say $decf-&gt;format(1234.5);  # '1.234,5'
    
        # when locale is 'es-MX' (Mexican Spanish)
        say $decf-&gt;format(1234.5);  # '1,234.5'
    
        # when locale is 'ar' (Arabic)
        say $decf-&gt;format(1234.5);  # 'ظ،ظ¬ظ¢ظ£ظ¤ظ«ظ¥'
    
        # percents
        $perf = $cldr-&gt;percent_formatter;
    
        # when locale is 'tr' (Turkish)
        say $perf-&gt;format(0.05);  # '%5'
    
        # currencies
        $curf = $cldr-&gt;currency_formatter(currency_code =&gt; 'USD');
    
        # when locale is 'en' (English) and currency is USD (US dollars)
        say $curf-&gt;format(9.99);  # '$9.99'
    
        # when locale is 'en-CA' (Canadian English) and currency is USD
        say $curf-&gt;format(9.99);  # 'US$9.99'
    
        # when locale is 'fr-CA' (Canadian French) and currency is USD
        say $curf-&gt;format(9.99);  # '9,99 $ US'

DEPRECATION

    Using the locale method as a setter is deprecated. In the future the
    objectâ€™s locale will become immutable. Please see issue #38
    &lt;https://github.com/patch/cldr-number-pm5/issues/38&gt; for details and to
    submit comments or concerns.

DESCRIPTION

    Software localization includes much more than just translations.
    Numbers, prices, and even percents should all be localized based on the
    userâ€™s language, script, and region. Fortunately, the Unicode Common
    Locale Data Repository (CLDR) provides locale data and specifications
    for formatting numeric data to use with many of the worldâ€™s locales.

    This class provides common attributes shared among the supported
    formatter classes as well as methods to instantiate decimal, percent,
    and currency formatter objects. The value for any attribute (such as
    locale or decimal_sign) will be passed to the formatter objects on
    instantiation but can be overwritten by manually passing another value
    for the attribute or calling a setter method on the formatter object.

 Methods

    decimal_formatter

      Returns a decimal formatter, which is a CLDR::Number::Format::Decimal
      object instantiated with all of the attributes from your CLDR::Number
      object as well as any attributes passed to this method.

    percent_formatter

      Returns a percent formatter, which is a CLDR::Number::Format::Percent
      object instantiated with all of the attributes from your CLDR::Number
      object as well as any attributes passed to this method.

    currency_formatter

      Returns a currency formatter, which is a
      CLDR::Number::Format::Currency object instantiated with all of the
      attributes from your CLDR::Number object as well as any attributes
      passed to this method.

 Common Attributes

    These are common attributes among this class and all formatter classes.
    All attributes other than locale, default_locale, and cldr_version have
    defaults that change depending on the current locale. All string
    attributes are expected to be character strings, not byte strings.

    locale

      Default: value of default_locale attribute if it exists, otherwise
      root

      Valid: Unicode locale identifiers

      Examples: es (Spanish), es-ES (European Spanish), es-419 (Latin
      American Spanish), zh-Hant (Traditional Chinese), zh-Hans (Simplified
      Chinese), chr (Cherokee)

      The locale is case-insensitive and can use either - (hyphen-minus) or
      _ (low line) as a separator.

    default_locale

      Default: none

      Valid: Unicode locale identifiers

      Use this if you want a locale other than the generic root if the
      locale attribute is not set or not valid.

    numbering_system

      Valid: currently only decimal numbering systems are supported

      Examples: latn (Western Digits), arab (Arabic-Indic Digits), hanidec
      (Chinese Decimal Numerals), fullwide (Full Width Digits)

      In the future, algorithmic numbering systems like hant (Traditional
      Chinese Numerals), hebr (Hebrew Numerals), and roman (Roman Numerals)
      will be supported.

      The numbering system may alternately be provided as a Unicode locale
      extension subtag. For example, locale ja-u-nu-fullwide for the
      Japanese language (ja) with the numbering system (nu) set to Full
      Width Digits (fullwide).

    decimal_sign

      Examples: . (full stop) for root, en; , (comma) for de, fr

    group_sign

      Examples: , (comma) for root, en; . (full stop) for de;	(no-break
      space) for fr

    plus_sign

      Examples: + (plus sign) for root, en, and most locales

    minus_sign

      Examples: - (hyphen-minus) for root, en, and most locales

    cldr_version

      Value: 27.0.1

      This is a read-only attribute that will always reflect the currently
      supported Unicode CLDR version.

NOTES

    The Unicode private-use characters U+F8F0 through U+F8F4 are used
    internally and are therefore not supported in custom patterns and
    signs.

SEE ALSO

      * CLDR::Number::FAQ

      * CLDR::Number::TODO

      * Unicode beyond just characters: Localization with the CLDR
      &lt;http://patch.codes/talks/localization-with-the-unicode-cldr/&gt; (video
      and slides)

      * Perl Advent Calendar: CLDR TL;DR
      &lt;http://perladvent.org/2014/2014-12-23.html&gt;

      * UTS #35: Unicode LDML, Part 3: Numbers
      &lt;http://www.unicode.org/reports/tr35/tr35-numbers.html&gt;

      * CLDR Translation Guidelines: Number Patterns
      &lt;http://cldr.unicode.org/translation/number-patterns&gt;

      * CLDR Translation Guidelines: Number Symbols
      &lt;http://cldr.unicode.org/translation/number-symbols&gt;

AUTHOR

    Nova Patch &lt;patch@cpan.org&gt;

    This project is brought to you by Shutterstock
    &lt;http://www.shutterstock.com/&gt;. Additional open source projects from
    Shutterstock can be found at code.shutterstock.com
    &lt;http://code.shutterstock.com/&gt;.

COPYRIGHT AND LICENSE

    آ© 2013â€“2015 Shutterstock, Inc.

    This library is free software; you can redistribute it and/or modify it
    under the same terms as Perl itself.

    Unicode is a registered trademark of Unicode, Inc., in the United
    States and other countries.

</pre></body></html>