num-to-english

Crates.ionum-to-english
lib.rsnum-to-english
version0.1.0
created_at2025-11-09 16:34:45.529832+00
updated_at2025-11-09 16:34:45.529832+00
descriptionConvert integers to their English word representation.
homepagehttps://github.com/christoffetzer/num-to-english
repositoryhttps://github.com/christoffetzer/num-to-english
max_upload_size
id1924268
size5,311
Scontain (scontain)

documentation

https://docs.rs/num-to-english

README

num-to-english

Convert integers 0..127 into their English word representation. Suitable for formatting numbers in logs, UI output, reports, accessibility features, and educational tools.

use num_to_english::english;

fn main() {
    assert_eq!(english(42), (42, "fortytwo".to_string()));
    assert_eq!(english(127), (127, "one hundred twentyseven".to_string()));
    assert_eq!(english(7), (7, "seven".to_string()));
}

Installation

Add to your Cargo.toml:

[dependencies]
num-to-english = "0.1"

Usage

use num_to_english::english;

println!(r#"(84, "eightyfour") = {:?}"#, english(84));
println!(r"fortytwo = {}", english(42).1);
Commit count: 0

cargo fmt