https://github.com/kamaroly/kamaro_number
An Elixir package to spell out numbers into Words such as one hundred twenty three point thirty seven.
https://github.com/kamaroly/kamaro_number
Last synced: over 1 year ago
JSON representation
An Elixir package to spell out numbers into Words such as one hundred twenty three point thirty seven.
- Host: GitHub
- URL: https://github.com/kamaroly/kamaro_number
- Owner: kamaroly
- Created: 2023-02-23T16:41:01.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-02-23T17:36:53.000Z (over 3 years ago)
- Last Synced: 2025-01-21T23:32:03.359Z (over 1 year ago)
- Language: Elixir
- Size: 8.79 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# KamaroNumber
**An Elixir package that convert numbers to Words**
## Installation
If [available in Hex](https://hex.pm/docs/publish), the package can be installed
by adding `kamaro_number` to your list of dependencies in `mix.exs`:
```elixir
def deps do
[
{:kamaro_number, "~> 0.1.0"}
]
end
```
Documentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc)
and published on [HexDocs](https://hexdocs.pm). Once published, the docs can
be found at .
## Usage Examples
```ex
KamaroNumber.convert(100)
# "one hundred"
KamaroNumber.convert(100.5)
# "one hundred point five"
KamaroNumber.convert(4.9)
"# four point nine"
KamaroNumber.convert(21.7)
"tw# enty-one point seven"
KamaroNumber.convert(1000)
# "one thousand"
KamaroNumber.convert(10000)
# "ten thousand"
KamaroNumber.convert(100_000)
# "one hundred thousand"
KamaroNumber.convert(1_000_000)
# "one million"
KamaroNumber.convert(1_000_023)
# "one million and twenty-three"
KamaroNumber.convert(1_000_000_000_000_000_000)
# "one quintillion"
```