Crates.io | say-number |
lib.rs | say-number |
version | 1.0.0 |
source | src |
created_at | 2019-12-28 20:56:43.386379 |
updated_at | 2020-01-23 16:03:23.489888 |
description | Library to say numbers in English, Chinese (simplified), French, Japanese and Vietnamese |
homepage | |
repository | https://github.com/minhnhdo/say-number |
max_upload_size | |
id | 193047 |
size | 42,412 |
Library to say numbers in English, Chinese (simplified), French, Japanese and Vietnamese.
Add the following to your Cargo.toml
file.
[dependencies]
say-number = "0.1"
println!("The number is {}.", say_number::say(42));
assert_eq!(say_number::say(514), "five hundred and fourteen".to_string());
assert_eq!(say_number::english::say(514), "five hundred and fourteen".to_string());
assert_eq!(say_number::chinese_simplified::say(514), "五百一十四".to_string());
assert_eq!(say_number::french::say(514), "cinq-cent-quatorze".to_string());
assert_eq!(say_number::japanese::say(514), "五百十四".to_string());
assert_eq!(say_number::vietnamese::say(514), "năm trăm mười bốn".to_string());