{"id":32024206,"url":"https://github.com/ballasi/num2words","last_synced_at":"2025-10-16T11:01:55.478Z","repository":{"id":57647079,"uuid":"474164782","full_name":"Ballasi/num2words","owner":"Ballasi","description":"Convert numbers like 42 to forty-two","archived":false,"fork":false,"pushed_at":"2024-08-21T15:06:22.000Z","size":106,"stargazers_count":18,"open_issues_count":10,"forks_count":10,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-25T14:48:08.577Z","etag":null,"topics":["num2words","number-converter","number-spelling","numbers","numtowords","rust","rust-lang"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/num2words","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Ballasi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-03-25T21:11:04.000Z","updated_at":"2025-06-15T19:22:11.000Z","dependencies_parsed_at":"2024-03-14T00:25:26.738Z","dependency_job_id":"344a4e18-eb72-4cfe-8333-f2c5b7e01f08","html_url":"https://github.com/Ballasi/num2words","commit_stats":{"total_commits":59,"total_committers":4,"mean_commits":14.75,"dds":0.06779661016949157,"last_synced_commit":"e3ede741feb98697b6cffbbd8abeb5d69292b835"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/Ballasi/num2words","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ballasi%2Fnum2words","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ballasi%2Fnum2words/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ballasi%2Fnum2words/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ballasi%2Fnum2words/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ballasi","download_url":"https://codeload.github.com/Ballasi/num2words/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ballasi%2Fnum2words/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279181239,"owners_count":26120909,"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","status":"online","status_checked_at":"2025-10-16T02:00:06.019Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["num2words","number-converter","number-spelling","numbers","numtowords","rust","rust-lang"],"created_at":"2025-10-16T11:01:02.723Z","updated_at":"2025-10-16T11:01:55.472Z","avatar_url":"https://github.com/Ballasi.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# num2words\n\n\u003ca href=\"https://crates.io/crates/num2words\"\u003e\u003cimg src=\"https://img.shields.io/crates/v/num2words\"/\u003e\u003c/a\u003e \u003ca href=\"https://crates.io/crates/num2words\"\u003e\u003cimg src=\"https://img.shields.io/crates/d/num2words\"/\u003e\u003c/a\u003e \u003ca href=\"https://docs.rs/num2words\"\u003e\u003cimg src=\"https://img.shields.io/docsrs/num2words\"/\u003e\u003c/a\u003e \u003ca href=\"#license\"\u003e\u003cimg src=\"https://img.shields.io/crates/l/num2words\"/\u003e\u003c/a\u003e\n\nConvert numbers like `42` to `forty-two`\n\n## Usage\n\nThis crate can be either used as a library or a binary.\n\n### Library\n\nExample usage:\n\n```rust\nuse num2words::Num2Words;\nassert_eq!(Num2Words::new(42).to_words(), Ok(String::from(\"forty-two\")));\n```\n\nThe builder `Num2Words` can take any of these methods: `lang`, `cardinal`,\n`ordinal`, `ordinal_num`, `year`, and `currency`.\n\n```rust\nuse num2words::*;\nassert_eq!(\n    Num2Words::new(42).lang(Lang::French).to_words(),\n    Ok(String::from(\"quarante-deux\"))\n);\nassert_eq!(\n    Num2Words::new(42).ordinal().to_words(),\n    Ok(String::from(\"forty-second\"))\n);\nassert_eq!(\n    Num2Words::new(42.01).currency(Currency::DOLLAR).to_words(),\n    Ok(String::from(\"forty-two dollars and one cent\"))\n);\n```\n\nThese arguments can be chained.\n\nFor more information about the available languages, outputs types and\ncurrencies, see [Information](#information).\n\n### Binary\n\nThis crate provides a command-line interface to run requests on `num2words`.\n\nExample:\n\n```sh\n$ num2words 42\nforty-two\n$ num2words 10 --to UAH --lang uk\nдесять гривень\n```\n\nYou can download the app via the following command:\n\n```sh\n$ cargo install num2words\n```\n\nYou can also change the language via the CLI argument `--lang [locale]` and\nprovide a specific output type or a currency with the argument\n`--to [cardinal|ordinal|ordinal_num|year|ISO 4217]`.\n\nFor more information about the usage of `num2words` please refer to the docs\nor via the following command:\n\n```sh\n$ num2words --help\n```\n\n## Information\n\n### Supported languages\n\nHere is a list of all of the supported languages:\n\n| Flag | Code              | Locale    | Language    | 42            |\n| ---- | ----------------- | --------- | ----------- | ------------- |\n| 🇺🇸🇬🇧 | `Lang::English`   | `en`      | English     | forty-two     |\n| 🇫🇷🇨🇦 | `Lang::French`    | `fr`      | French      | quarante-deux |\n| 🇧🇪🇨🇩 | `Lang::French_BE` | `fr_BE`   | French (BE) | quarante-deux |\n| 🇨🇭   | `Lang::French_CH` | `fr_CH`   | French (CH) | quarante-deux |\n| 🇺🇦   | `Lang::Ukrainian` | `uk`      | Ukrainian   | сорок два     |\n\nThis list can be expanded! Contributions are welcomed.\n\n### Supported output types\n\nHere is a list of all of the supported outputs types (with the associated\ncommand-line interface code):\n\n| Library method   | CLI argument  | Example output                         |\n| ---------------- | ------------- | -------------------------------------- |\n| `.cardinal()`    | `cardinal`    | forty-two (42)                         |\n| `.ordinal()`     | `ordinal`     | forty-second (42)                      |\n| `.ordinal_num()` | `ordinal_num` | 42nd (42)                              |\n| `.year()`        | `year`        | nineteen oh-one (1901)                 |\n| `.currency(cur)` | ISO 4217 code | forty-two dollars and one cent (42.01) |\n\n### Supported currencies\n\nThree-letter enum variants corresponds to the currency's ISO 4217 code, but\nthere are exceptions to accomodate generic terminologies: `DINAR`, `DOLLAR`,\n`PESO` and `RIYAL`.\n\nA summary of all of the supported currencies are available in the [documentation\nof `Currency`](https://docs.rs/num2words/latest/num2words/enum.Currency.html).\n\n### About\n\nThis library is widely inspired by [Savoir-faire Linux's Python\nlib](https://github.com/savoirfairelinux/num2words/).\n\n## License\n\nLicensed under either of\n\n- Apache License, Version 2.0\n  ([LICENSE-APACHE](LICENSE-APACHE) or\n  http://www.apache.org/licenses/LICENSE-2.0)\n- MIT license\n  ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)\n\nat your option.\n\n## Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you, as defined in the Apache-2.0 license,\nshall be dual licensed as above, without any additional terms or conditions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fballasi%2Fnum2words","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fballasi%2Fnum2words","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fballasi%2Fnum2words/lists"}