{"id":15017772,"url":"https://github.com/patch/cldr-number-pm5","last_synced_at":"2025-04-09T19:42:40.768Z","repository":{"id":11422753,"uuid":"13874569","full_name":"patch/cldr-number-pm5","owner":"patch","description":"Localized number formatters using the Unicode CLDR","archived":false,"fork":false,"pushed_at":"2016-10-05T19:47:54.000Z","size":475,"stargazers_count":8,"open_issues_count":22,"forks_count":3,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-23T21:45:44.383Z","etag":null,"topics":["cldr","i18n","perl5","unicode"],"latest_commit_sha":null,"homepage":"https://metacpan.org/pod/CLDR::Number","language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/patch.png","metadata":{"files":{"readme":"README.md","changelog":"Changes","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-10-25T23:38:32.000Z","updated_at":"2020-10-30T05:49:37.000Z","dependencies_parsed_at":"2022-09-08T07:50:54.791Z","dependency_job_id":null,"html_url":"https://github.com/patch/cldr-number-pm5","commit_stats":null,"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patch%2Fcldr-number-pm5","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patch%2Fcldr-number-pm5/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patch%2Fcldr-number-pm5/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patch%2Fcldr-number-pm5/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/patch","download_url":"https://codeload.github.com/patch/cldr-number-pm5/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248101200,"owners_count":21047924,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cldr","i18n","perl5","unicode"],"created_at":"2024-09-24T19:50:58.284Z","updated_at":"2025-04-09T19:42:40.747Z","avatar_url":"https://github.com/patch.png","language":"Perl","readme":"![Perl CLDR](https://www.gravatar.com/avatar/656f15a25eff4437f5a82e7c929f41dd?s=96)\n\n[![Build status](https://travis-ci.org/patch/cldr-number-pm5.png)](https://travis-ci.org/patch/cldr-number-pm5)\n[![Coverage status](https://coveralls.io/repos/patch/cldr-number-pm5/badge.png)](https://coveralls.io/r/patch/cldr-number-pm5)\n[![CPAN version](https://badge.fury.io/pl/CLDR-Number.png)](http://badge.fury.io/pl/CLDR-Number)\n\n# NAME\n\nCLDR::Number - Localized number formatters using the Unicode CLDR\n\n# VERSION\n\nThis document describes CLDR::Number v0.19, built with Unicode CLDR v29.\n\n# SYNOPSIS\n\n```perl\nuse CLDR::Number;\n\n# new object with 'es' (Spanish) locale\n$cldr = CLDR::Number-\u003enew(locale =\u003e 'es');\n\n# decimals\n$decf = $cldr-\u003edecimal_formatter;\n\n# when locale is 'es' (Spanish)\nsay $decf-\u003eformat(1234.5);  # '1234,5'\n\n# when locale is 'es-MX' (Mexican Spanish)\nsay $decf-\u003eformat(1234.5);  # '1,234.5'\n\n# when locale is 'ar' (Arabic)\nsay $decf-\u003eformat(1234.5);  # '١٬٢٣٤٫٥'\n\n# percents\n$perf = $cldr-\u003epercent_formatter;\n\n# when locale is 'tr' (Turkish)\nsay $perf-\u003eformat(0.05);  # '%5'\n\n# currencies\n$curf = $cldr-\u003ecurrency_formatter(currency_code =\u003e 'USD');\n\n# when locale is 'en' (English) and currency is USD (US dollars)\nsay $curf-\u003eformat(9.99);  # '$9.99'\n\n# when locale is 'en-CA' (Canadian English) and currency is USD\nsay $curf-\u003eformat(9.99);  # 'US$9.99'\n\n# when locale is 'fr-CA' (Canadian French) and currency is USD\nsay $curf-\u003eformat(9.99);  # '9,99 $ US'\n```\n\n# DEPRECATION\n\nUsing the `locale` method as a setter is deprecated. In the future the object’s\nlocale will become immutable. Please see\n[issue #38](https://github.com/patch/cldr-number-pm5/issues/38) for details and\nto submit comments or concerns.\n\n# DESCRIPTION\n\nSoftware localization includes much more than just translations. Numbers,\nprices, and even percents should all be localized based on the user’s language,\nscript, and region. Fortunately, the Unicode Common Locale Data Repository\n(CLDR) provides locale data and specifications for formatting numeric data to\nuse with many of the world’s locales.\n\nThis class provides common attributes shared among the supported formatter\nclasses as well as methods to instantiate decimal, percent, and currency\nformatter objects. The value for any attribute (such as **locale** or\n**decimal\\_sign**) will be passed to the formatter objects on instantiation but\ncan be overwritten by manually passing another value for the attribute or\ncalling a setter method on the formatter object.\n\n## Methods\n\n- decimal\\_formatter\n\n    Returns a decimal formatter, which is a [CLDR::Number::Format::Decimal](https://metacpan.org/pod/CLDR::Number::Format::Decimal) object\n    instantiated with all of the attributes from your CLDR::Number object as well as\n    any attributes passed to this method.\n\n- percent\\_formatter\n\n    Returns a percent formatter, which is a [CLDR::Number::Format::Percent](https://metacpan.org/pod/CLDR::Number::Format::Percent) object\n    instantiated with all of the attributes from your CLDR::Number object as well as\n    any attributes passed to this method.\n\n- currency\\_formatter\n\n    Returns a currency formatter, which is a [CLDR::Number::Format::Currency](https://metacpan.org/pod/CLDR::Number::Format::Currency)\n    object instantiated with all of the attributes from your CLDR::Number object as\n    well as any attributes passed to this method.\n\n## Common Attributes\n\nThese are common attributes among this class and all formatter classes. All\nattributes other than **locale**, **default\\_locale**, and **cldr\\_version** have\ndefaults that change depending on the current **locale**. All string attributes\nare expected to be character strings, not byte strings.\n\n- locale\n\n    Default: value of **default\\_locale** attribute if it exists, otherwise `root`\n\n    Valid: Unicode locale identifiers\n\n    Examples: `es` (Spanish), `es-ES` (European Spanish), `es-419` (Latin\n    American Spanish), `zh-Hant` (Traditional Chinese), `zh-Hans` (Simplified\n    Chinese), `chr` (Cherokee)\n\n    The locale is case-insensitive and can use either `-` (hyphen-minus) or `_`\n    (low line) as a separator.\n\n- default\\_locale\n\n    Default: none\n\n    Valid: Unicode locale identifiers\n\n    Use this if you want a locale other than the generic `root` if the **locale**\n    attribute is not set or not valid.\n\n- numbering\\_system\n\n    Valid: currently only decimal numbering systems are supported\n\n    Examples: `latn` (Western Digits), `arab` (Arabic-Indic Digits), `hanidec`\n    (Chinese Decimal Numerals), `fullwide` (Full Width Digits)\n\n    In the future, algorithmic numbering systems like `hant` (Traditional Chinese\n    Numerals), `hebr` (Hebrew Numerals), and `roman` (Roman Numerals) will be\n    supported.\n\n    The numbering system may alternately be provided as a Unicode locale extension\n    subtag. For example, locale `ja-u-nu-fullwide` for the Japanese language\n    (`ja`) with the numbering system (`nu`) set to Full Width Digits\n    (`fullwide`).\n\n- decimal\\_sign\n\n    Examples: `.` (full stop) for **root**, **en**; `,` (comma) for **de**, **fr**\n\n- group\\_sign\n\n    Examples: `,` (comma) for **root**, **en**; `.` (full stop) for **de**; ` `\n    (no-break space) for **fr**\n\n- plus\\_sign\n\n    Examples: `+` (plus sign) for **root**, **en**, and most locales\n\n- minus\\_sign\n\n    Examples: `-` (hyphen-minus) for **root**, **en**, and most locales\n\n- infinity\n\n    Examples: `∞` (infinity) for **root**, **en**, and almost all locales\n\n- nan\n\n    Examples: `NaN` for **root**, **en**, and most locales; many other variations for\n    individual locales like `не число` for **ru** and `非數值` for **zh-Hant**\n\n- cldr\\_version\n\n    Value: `29`\n\n    This is a read-only attribute that will always reflect the currently supported\n    Unicode CLDR version.\n\n# NOTES\n\nThe Unicode private-use characters U+F8F0 through U+F8F4 are used internally and\nare therefore not supported in custom patterns and signs.\n\n# SEE ALSO\n\n- [CLDR::Number::FAQ](https://metacpan.org/pod/CLDR::Number::FAQ)\n- [CLDR::Number::TODO](https://metacpan.org/pod/CLDR::Number::TODO)\n- [Unicode beyond just characters: Localization with the\nCLDR](http://patch.codes/talks/localization-with-the-unicode-cldr/) (video and\nslides)\n- [Perl Advent Calendar:\nCLDR TL;DR](http://perladvent.org/2014/2014-12-23.html)\n- [UTS #35: Unicode LDML, Part 3:\nNumbers](http://www.unicode.org/reports/tr35/tr35-numbers.html)\n- [CLDR Translation Guidelines: Number\nPatterns](http://cldr.unicode.org/translation/number-patterns)\n- [CLDR Translation Guidelines: Number\nSymbols](http://cldr.unicode.org/translation/number-symbols)\n\n# AUTHOR\n\nNova Patch \u0026lt;patch@cpan.org\u003e\n\nThis project is brought to you by [Shutterstock](http://www.shutterstock.com/).\nAdditional open source projects from Shutterstock can be found at\n[code.shutterstock.com](http://code.shutterstock.com/).\n\n# COPYRIGHT AND LICENSE\n\n© 2013–2016 Shutterstock, Inc.\n\nThis library is free software; you can redistribute it and/or modify it under\nthe same terms as Perl itself.\n\nUnicode is a registered trademark of Unicode, Inc., in the United States and\nother countries.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatch%2Fcldr-number-pm5","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpatch%2Fcldr-number-pm5","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatch%2Fcldr-number-pm5/lists"}