{"id":18105037,"url":"https://github.com/roberwil/ada_numbers","last_synced_at":"2026-05-05T07:31:18.105Z","repository":{"id":39642738,"uuid":"495164089","full_name":"roberwil/ada_numbers","owner":"roberwil","description":"It converts a number to its equivalent in written words, i.e. 123 to \"cento e vinte três\" or to \"one hundred and twenty-three\",  and vice versa.","archived":false,"fork":false,"pushed_at":"2023-03-31T20:36:43.000Z","size":103,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-19T07:39:47.964Z","etag":null,"topics":["csharp","csharp-library","dotnet","dotnet-core","dotnet-standard"],"latest_commit_sha":null,"homepage":"","language":"C#","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/roberwil.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,"publiccode":null,"codemeta":null}},"created_at":"2022-05-22T19:59:58.000Z","updated_at":"2023-03-30T05:01:41.000Z","dependencies_parsed_at":"2024-12-19T14:10:43.394Z","dependency_job_id":"799fdc79-e08a-4f66-9748-3ea5ae1dd3f7","html_url":"https://github.com/roberwil/ada_numbers","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/roberwil/ada_numbers","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roberwil%2Fada_numbers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roberwil%2Fada_numbers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roberwil%2Fada_numbers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roberwil%2Fada_numbers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/roberwil","download_url":"https://codeload.github.com/roberwil/ada_numbers/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roberwil%2Fada_numbers/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32640533,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-04T10:08:07.713Z","status":"online","status_checked_at":"2026-05-05T02:00:06.033Z","response_time":54,"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":["csharp","csharp-library","dotnet","dotnet-core","dotnet-standard"],"created_at":"2024-10-31T22:16:52.491Z","updated_at":"2026-05-05T07:31:18.090Z","avatar_url":"https://github.com/roberwil.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ada.Numbers\n\n**Find the package at nuget [here](https://www.nuget.org/packages/Ada.Numbers/)**.\n\n### Features:\n - It converts a number to its equivalent in written words, i.e. 123 to \"cento e vinte três\" or 123 to\n\"one hundred and twenty-three\" depending on the chosen language;\n - It converts a word to its equivalent in number, i.e. \"cento e vinte dois\" to \"122\" or \"one hundred and twenty-two\"\nto \"122\".\n\n**Note: `ada.numbers` supports numbers with a maximum of 15 digits.**\n\n### Specification\n\nAvailable namespaces are:\n- `Ada.Numbers.Settings` which contains the settings for the converters;\n- `Ada.Numbers.Converters` which contains the extension methods for conversion;\n- `Ada.Numbers.Constants` which contains the constants used in conversions;\n- `Ada.Numbers.Utilities` which contains some useful methods such as the number of digits and the category of the number.\n\n`Ada.Numbers.Settings`\n\nUsed to set the parameters of the converters. Available parameters are:\n\n- Language;\n- Scale.\n\nTo set the **language**, it is done as follows:\n\n```csharp\nSettings.Language = Settings.Parameters.Languages.En //Now, converters will use English\n```\n\nTo set the **scale**, it is done as follows:\n\n```csharp\nSettings.Scale = Settings.Parameters.Scales.Short //Now, converters will use Short Scale\n```\n\nTo learn more about scales, read [this](https://en.wikipedia.org/wiki/Long_and_short_scales).\n\nThe Settings are global, meaning that once they are set, every operation is affected, so, in order to\nhave a different behavior, the Settings must be explicitly set.\nPer default, Language is **Portuguese** and the Scale is **Long**.\n\n`Ada.Numbers.Converters`\n\nFor `string`, the method is `.ToNumber()`.\n\nExamples:\n\n```csharp\nvar number = \"vinte e dois\";\nnumber.ToNumber() // \u003e \"22\"\n\nSettings.Language = Settings.Parameters.Languages.En //Now, converters will use English\nnumber = \"twenty-two\";\nnumber.ToNumber(); // \u003e \"22\"\n```\n\nCheck the method documentation for more details.\n\nFor numerical types (`long, int, byte, decimal, double and float`), the method is `.ToWords()`.\n\n\n```csharp\nvar number = 22;\nnumber.ToWords() // \u003e \"Vinte e Dois\"\n\nSettings.Language = Settings.Parameters.Languages.En //Now, converters will use English\nvar number = 22;\nnumber.ToWords() // \u003e \"Twenty-two\"\n```\n\nCheck the method documentation for more details.\n\n\n`Ada.Numbers.Constants`\n\nIt includes the classes:\n- `Messages`: for useful messages, check the class documentation for more details.\n- `Separators`: for number separator in Portuguese, check the class documentation for more details.\n- `SeparatorsEn`: for number separator in English, check the class documentation for more details.\n\n\n`Ada.Numbers.Utilities`\n\nIt includes extension methods for:\n- `.NumberOfDigits()` available for `long, int and byte`: it returns the number of digits a number has.\n\n```csharp\nvar number = 22;\nnumber.NumberOfDigits() // \u003e 2\n```\n\n- `.Category()` available for `long, int and byte`: it returns the the category of the number.\n\n```csharp\nvar number = 22;\nnumber.Category() // \u003e NumberCategory.Ten\n```\n\n`NumberCategory` is an enum, check its documentation for more details.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froberwil%2Fada_numbers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Froberwil%2Fada_numbers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froberwil%2Fada_numbers/lists"}