Crate ntext[][src]

extern crate ntext;
use ntext::digit_to_text;
fn main() {
    println!("{}",digit_to_text(1).unwrap());
    assert_eq!("two",digit_to_text(2).unwrap());
    assert_ne!("five",digit_to_text(8).unwrap());
}

However giving the program a zero will return an empty string.

extern crate ntext;
use ntext::to_text;
fn main() {
     println!("{}",to_text(1312));
     assert_eq!(to_text(1312),"onethousandthreehundredtwelve");
}

This fucntion will also return an empty string on input zero

Functions

digit_to_text

Convert digit to text.

to_text

Convert u32 to words in a string.