Crates.io | numatim |
lib.rs | numatim |
version | 0.2.2 |
source | src |
created_at | 2020-12-22 17:25:39.892886 |
updated_at | 2020-12-22 17:43:12.182075 |
description | Returns a given number in words. |
homepage | https://gitlab.com/maksrawski/numatim |
repository | https://gitlab.com/maksrawski/numatim |
max_upload_size | |
id | 326098 |
size | 198,717 |
Returns a given number in words. To choose a language use the -l
option.
Supported languages can be found in dicts
. Default language is English.
This project is work in progress so if it's impossible to implement a dict for a particular language please open an issue.
cargo install numatim
Dicts should have two main sections:
If a certain number's or power's declination needs to be hardcoded it must be put inside an array. How exactly that must be done can be found in particular sections. Take a look at the dicts folder for a real life examples.
Numbers must contain 3 arrays of strings:
[tenth, rest]
eg. ["twelve", "twenty"]
Put all your powers of thousand here. Amount of them is truly arbitrary.
[1, 2-4, 5-9]
, for now it can't be omitted.[1, 2-4, 5-9]
(2-4 will also be used for numbers in range 10-19).