Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/florian-obernberger/spell_out_numbers
A simple package for dart and flutter which converts numbers to English words with more languages to come!
https://github.com/florian-obernberger/spell_out_numbers
dart flutter
Last synced: 7 days ago
JSON representation
A simple package for dart and flutter which converts numbers to English words with more languages to come!
- Host: GitHub
- URL: https://github.com/florian-obernberger/spell_out_numbers
- Owner: florian-obernberger
- License: mit
- Created: 2022-03-22T00:24:45.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-03-22T22:46:31.000Z (over 2 years ago)
- Last Synced: 2024-08-01T12:23:17.789Z (3 months ago)
- Topics: dart, flutter
- Language: Dart
- Homepage:
- Size: 63.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Spell Out Numbers
[![License](https://img.shields.io/github/license/florian-obernberger/spell_out_numbers)](./LICENSE)
[![Dart](https://github.com/florian-obernberger/spell_out_numbers/actions/workflows/dart.yml/badge.svg)](https://github.com/florian-obernberger/spell_out_numbers/actions/workflows/dart.yml)## Features
Writes put the name of a number given in different languages.
Currently only English is supported, but in the future I will
add more languages. If anyone is interested in helping me with
that, feel free to contact me / open an issue.## Language Support
- [x] English
- [ ] German / Deutsch
- [ ] Spanish / Español## Usage
There is one abstract class (`LanguageNumberScheme`) that all
other classes inherit from. This class and all classes extending
this one provide amongst others the following methods and getters:- `toWord(num number)`: converts the number given into words
- `num get maxNumber;`: the largest number supported by the scheme
- `int get maxDecimals;`: the maximum number of decimal values## Examples
```dart
LanguageNumberScheme scheme = EnglishNumberScheme();print(scheme.toWord(10));
// ten
``````dart
LanguageNumberScheme scheme = EnglishNumberScheme();print(scheme.toWord(-1398));
// minus one thousand three hundred ninety eight
```