Crates.io | numbers_into_words |
lib.rs | numbers_into_words |
version | 0.1.2 |
source | src |
created_at | 2023-05-20 14:40:58.647773 |
updated_at | 2023-05-23 17:52:59.826869 |
description | Command-line utility and library for writing a positive integer as English words |
homepage | |
repository | https://github.com/christopherphan/numbers_into_words |
max_upload_size | |
id | 869468 |
size | 71,288 |
Converts an integer into English words.
License: MIT OR Apache-2.0
target/debug/numbers_into_words [OPTIONS] [NUMBERS]
--help
: Display help message
--and=
(none
| last
| below1k
| all
): Specify when the word "and"
should be used in phrases like "five-hundred and seventy-two"
--and-help
: Describe the options for --and=
--minimal
: Output only the words for each number (rather than prefacing
with the numerals, e.g. "five" instead of "5: five")
--and=none
: Don't use the word "and" (e.g. "five-hundred seventy-two")
--and=last
: Only use the word "and" in the hundreds-tens-units group (e.g.
"three-hundred five thousand, five-hundred and seventy-two", but
"three-hundred five million, five-hundred seventy-two thousand")
--and=below1k
: Only use the word "and" for numbers below 1000 (e.g.
"three-hundred five thousand, five-hundred seventy-two", but "three-hundred
and five")
--and=all
: Always use "and" (default behavior) (e.g. "five-hundred and
twenty-four million, three-hundred and seventy-eight")
$ numbers_into_words 234 92,582,349 543_953_459_343 8
234: two-hundred and thirty-four
92582349: ninety-two million, five-hundred and eighty-two thousand, three-hundred and forty-nine
543953459343: five-hundred and forty-three billion, nine-hundred and fifty-three million, four-hundred and fifty-nine thousand, three-hundred and forty-three
8: eight
$ numbers_into_words --minimal 593_123 45,230
five-hundred and ninety-three thousand, one-hundred and twenty-three
forty-five thousand, two-hundred and thirty
$ numbers_into_words --minimal --and=last 532_428_000 1000355
five-hundred thirty-two million, four-hundred twenty-eight thousand
one million, three-hundred and fifty-five
$ numbers_into_words -and=below1k 400_000_000_123 678
400000000123: four-hundred billion, one-hundred twenty-three
678: six-hundred and seventy-eight