| Crates.io | cardinalize_numbers |
| lib.rs | cardinalize_numbers |
| version | 0.1.0 |
| created_at | 2025-04-28 00:53:02.575795+00 |
| updated_at | 2025-04-28 00:53:02.575795+00 |
| description | A Rust library for converting numbers into their cardinal English text representation |
| homepage | |
| repository | https://github.com/kmooney/cardinalize_numbers |
| max_upload_size | |
| id | 1651641 |
| size | 8,375 |
A Rust library that converts numbers into their cardinal English text representation.
Add this to your Cargo.toml:
[dependencies]
cardinalize_numbers = "0.1.0"
Then use it in your code:
use cardinalize_numbers::cardinalize_us_en;
fn main() {
let number = 123456;
let text = cardinalize_us_en(number);
println!("{}: {}", number, text); // Outputs: 123456: one hundred twenty three thousand four hundred fifty six
}
1 → "one"
100 → "one hundred"
575 → "five hundred seventy five"
8575 → "eight thousand five hundred seventy five"
1398575 → "one million three hundred ninety eight thousand five hundred seventy five"
Run the tests with:
cargo test
This project is available as open source under the terms of the MIT License.