{"id":34646596,"url":"https://github.com/belmomusta/alpha-number","last_synced_at":"2026-05-28T05:32:30.757Z","repository":{"id":52802791,"uuid":"116535772","full_name":"BelmoMusta/alpha-number","owner":"BelmoMusta","description":"Convert numbers from digital format to letters.","archived":false,"fork":false,"pushed_at":"2023-08-14T02:50:46.000Z","size":65,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2023-08-14T03:34:58.372Z","etag":null,"topics":["bigdecimal","conversion","java","numbers"],"latest_commit_sha":null,"homepage":"https://belmomusta.github.io/alpha-number/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BelmoMusta.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-01-07T03:59:05.000Z","updated_at":"2023-07-12T04:42:09.000Z","dependencies_parsed_at":"2022-08-22T19:10:25.853Z","dependency_job_id":null,"html_url":"https://github.com/BelmoMusta/alpha-number","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"purl":"pkg:github/BelmoMusta/alpha-number","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BelmoMusta%2Falpha-number","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BelmoMusta%2Falpha-number/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BelmoMusta%2Falpha-number/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BelmoMusta%2Falpha-number/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BelmoMusta","download_url":"https://codeload.github.com/BelmoMusta/alpha-number/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BelmoMusta%2Falpha-number/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33596316,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-28T02:00:06.440Z","response_time":99,"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":["bigdecimal","conversion","java","numbers"],"created_at":"2025-12-24T17:47:18.933Z","updated_at":"2026-05-28T05:32:30.752Z","avatar_url":"https://github.com/BelmoMusta.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Write numbers in words\n[![Maven Build](https://github.com/BelmoMusta/alpha-number/actions/workflows/maven.yml/badge.svg)](https://github.com/BelmoMusta/alpha-number/actions/workflows/maven.yml)\n[![Maven Test and Coverage](https://github.com/BelmoMusta/alpha-number/actions/workflows/test.yml/badge.svg)](https://github.com/BelmoMusta/alpha-number/actions/workflows/test.yml)\n\nConvert numbers from digital format to words.\n\nThis code provides a tool to convert a number from its digital value to the words format.\nThis release supports 3 built-in languages : `English`, `French` and `Arabic`.\n# Using as instance\n## Basic Example :\n\n```JAVA\nNumber x = 192345009;\nNumberInWords numberInWords = new NumberInWords(x, Locale.ENGLISH);\nSystem.out.println(numberInWords.toString());\n```\n\n```shell\none hundred ninety two million, three hundred forty five thousand, nine\n```\n## Decimal Format :\nThe decimals are supported too : \n```java\ndouble value = 200.0098;\nNumberInWords numberInWords = new NumberInWords(value);\nSystem.out.println(numberInWords.toString());\n```\n```shell\ntwo hundred and zero zero ninety eight\n```\n## Customization\nIf a customization is wanted, it will be by extending the `Rules` class and implement its method, the way the words format of a number is wanted.\nThen, the new `Extended Rules` will be registered for a locale, if it depends on a Region or a Language : \n```java\nLocalesRulesRegistry.register(Locale.XXXX, new MyNewRules());\n```\n\nOr simply create a number by providing the new Rules : \n```java\nNumberInWords numberInWords = new NumberInWords(29, new MyNewRules());\n```\n## Testing And Coverage\nTest are written in order to maintain the coverage of all the rules that implemented, but not to cover all the possible cases.\n\nCoverage is ensured to be `100%` on branches, lines, and methods.\n\n## Limitations\n- Some limitations are found, due to the big numbers, if a million multiple in a such rank does not exist, it will be replaced by `10^{rank}`.\n- Decimal numbers beyond 10^15 are recommended to be dealt with as `String` not with `double`, because the decimal part is lost when converting it to `BigDecimal`\n```java\nString x = \"1000000000000000.001\";\nNumberInWords numberInWords = new NumberInWords(x);\nString toLetters = numberInWords.toLetters();\n```\nThis will yield\n```shell\none quadrillion and zero zero one\n```\nWhereas \n\n```java\ndouble x = 1000000000000000.001;\nNumberInWords numberInWords = new NumberInWords(x);\nString toLetters = numberInWords.toLetters();\n```\nWill yield \n```shell\none quadrillion\n```\n## Usage a stateless Service\nThe conversion can be used without needing to create an instance for each number, \nwhich is useful for the dependency injection oriented architectures : \n\n```java\nRules frenchRules = LocalesRulesRegistry.get(Locale.FRANCE);\nINumberToWordsConverter numbersToWordsConverter = new NumberToWordsConverter();\nString numberInWords = numbersToWordsConverter.convert(\"1500\", frenchRules);\nSystem.out.println(numberInWords);\n```\n```shell\nmille cinq cents\n```\n\n## References \n[FR : Noms_des_grands_nombres](https://fr.wikipedia.org/wiki/Noms_des_grands_nombres) \n\n[EN : Names_of_large_numbers](https://en.wikipedia.org/wiki/Names_of_large_numbers) \n\n[EN : List_of_Illion_numbers](https://character.fandom.com/wiki/List_of_Illion_numbers) \n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbelmomusta%2Falpha-number","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbelmomusta%2Falpha-number","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbelmomusta%2Falpha-number/lists"}