https://github.com/wuletawwonte/numerify
A Ruby gem designed to effortlessly convert numbers between Arabic and various world languages, including Geez, Roman, and Chinese.
https://github.com/wuletawwonte/numerify
arabic geez numeral-systems ruby
Last synced: 9 months ago
JSON representation
A Ruby gem designed to effortlessly convert numbers between Arabic and various world languages, including Geez, Roman, and Chinese.
- Host: GitHub
- URL: https://github.com/wuletawwonte/numerify
- Owner: wuletawwonte
- License: mit
- Created: 2023-09-30T07:40:19.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-10-26T18:18:09.000Z (over 2 years ago)
- Last Synced: 2025-06-27T01:09:54.161Z (12 months ago)
- Topics: arabic, geez, numeral-systems, ruby
- Language: Ruby
- Homepage: https://rubygems.org/gems/numerify
- Size: 53.7 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Numerify
> A Ruby gem designed to effortlessly convert numbers between Arabic and various world languages, including Geez, Roman, and Chineese.
## Installation
```bash
$ gem install numerify
```
## Usage
These gem provides two approaches for converting numerals. The first is using Numerify.convert method as shown below.
```bash
> require 'numerify'
=> true
> Numerify.convert 123
=> "፻፳፫"
> Numerify.convert(324, :roman)
=> "CCCXXIV"
```
The second method utilizes monkey patching, to extend the `String` and `Integer` class of Ruby. With this approach, you can directly call the `convert` method on a string or an integer object.
```bash
> require 'numerify'
=> true
> "123".convert
=> "፻፳፫"
> 325.convert(:roman)
=> "CCCXXIV"
```
The list of numerals supported by this gem
geez: Geez,
roman: Roman,
chinese: Chinese,
thai: Thai,
bengali: Bengali,
devanagari: Devanagari,
gujarati: Gujarati,
gurmukhi: Gurmukhi,
kannada: Kannada,
khmer: Khmer,
lao: Lao,
malayalam: Malayalam,
myanmar: Myanmar
## Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/wuletawwonte/numerify.
## License
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
## Code of Conduct
Everyone interacting in the Numerify project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/wuletawwonte/numerify/blob/master/CODE_OF_CONDUCT.md).