{"id":13509367,"url":"https://github.com/alisinabh/numero","last_synced_at":"2025-10-05T14:39:44.940Z","repository":{"id":62430138,"uuid":"92991405","full_name":"alisinabh/Numero","owner":"alisinabh","description":"A micro library for converting non-english digits in elixir.","archived":false,"fork":false,"pushed_at":"2025-03-21T14:57:43.000Z","size":75,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-04T12:56:20.721Z","etag":null,"topics":["arabic-digits","digits","english-digits"],"latest_commit_sha":null,"homepage":"https://hex.pm/packages/numero","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alisinabh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2017-05-31T21:46:17.000Z","updated_at":"2025-03-21T14:57:46.000Z","dependencies_parsed_at":"2024-01-31T07:53:44.668Z","dependency_job_id":null,"html_url":"https://github.com/alisinabh/Numero","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alisinabh%2FNumero","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alisinabh%2FNumero/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alisinabh%2FNumero/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alisinabh%2FNumero/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alisinabh","download_url":"https://codeload.github.com/alisinabh/Numero/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248085444,"owners_count":21045163,"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":["arabic-digits","digits","english-digits"],"created_at":"2024-08-01T02:01:06.745Z","updated_at":"2025-10-05T14:39:39.889Z","avatar_url":"https://github.com/alisinabh.png","language":"Elixir","funding_links":[],"categories":["Text and Numbers"],"sub_categories":[],"readme":"# Numero\n\n[![Build Status][build-badge]](https://github.com/alisinabh/Numero)\n[![Module Version][version-shield]](https://hex.pm/packages/numero)\n[![Hex Docs][docs-badge]](https://hexdocs.pm/numero)\n\nNumero is a micro library for converting non-Western Arabic numerals, such as ۱\n(Farsi), ۲ (Bengali), ۳ (Devanagari), ੪ (Gurmukhi), and ๕ (Thai), into Western\nArabic numerals (1, 2, 3, 4, and 5, respectively). It also provides conversion\ninto `integer()` and `float()` [basic types][bt].\n\n## Supported Languages / Scripts\n\nAll numbers defined in Unicode 16.0.0 as `Nd` (numeric digit) class are\nsupported. For more information, see the Unicode specification chapter 4,\n[Character Properties][core-spec-4] sections on General Category and Numeric\nValue.\n\nThe conversion routine is derived from [DerivedNumericValues.txt][dnv].\n\n## Installation\n\nNumero can be installed by adding `numero` to your list of dependencies in\n`mix.exs`:\n\n```elixir\ndef deps do\n  [{:numero, \"~\u003e 0.5.0\"}]\nend\n```\n\n## Using Numero\n\nOn strings for strings:\n\n```elixir\nresult = Numero.normalize(\"1۲۳۰4a۳tس\")\n# result = \"12304a3tس\"\n```\n\nSmart numeric convert:\n\n(Convert numbers to Integer or Float based on input string)\n\n```elixir\nresult = Numero.normalize_as_number(\"1۲۳۰4۳\")\n# result = {:ok, 123043}\n\nresult = Numero.normalize_as_number(\"1۲۳۰4۳.۴5\")\n# result = {:ok, 123043.45}\n\nresult = Numero.normalize_as_number!(\"1۲۳۰4۳.۴5\")\n# result = 123043.45\n```\n\nStrip all non numeric chars from a string:\n\n```elixir\nresult = Numero.remove_non_digits(\"12 345abs\")\n# result = \"12345\"\n\n# Or even make exceptions for some chars like 'a' and ' ' (space)\nresult = Numero.remove_non_digits(\"12 345bas\", ~c[a ])\n# result = \"12 345a\"\n```\n\nChecking if a string is all numbers\n\n```elixir\nresult = Numero.digit_only?(\"1234567890\")\n# result = true\n\nresult = Numero.digit_only?(\"1234567890.a\")\n# result = false\n```\n\n[dnv]: https://www.unicode.org/Public/16.0.0/ucd/extracted/DerivedNumericValues.txt\n[core-spec-4]: https://www.unicode.org/versions/Unicode16.0.0/core-spec/chapter-4/\n[bt]: https://hexdocs.pm/elixir/typespecs.html#basic-types\n[build-badge]: https://github.com/alisinabh/Numero/actions/workflows/ci.yml/badge.svg\n[repo]: https://github.com/alisinabh/Numero\n[version-shield]: https://img.shields.io/hexpm/v/numero.svg\n[hex]: https://hex.pm/packages/numero\n[docs-badge]: https://img.shields.io/badge/hex-docs-lightgreen.svg\n[hexdocs]: https://hexdocs.pm/numero/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falisinabh%2Fnumero","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falisinabh%2Fnumero","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falisinabh%2Fnumero/lists"}