1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
//! `say-number` says numbers in English.
//!
//! # Quickstart
//!
//! Add the following to your [`Cargo.toml`](https://crates.io/) file.
//!
//! ```toml
//! [dependencies]
//! say-number = "0.1"
//! ```
//!
//! # Examples
//!
//! ```rust
//! println!("The number is {}.", say_number::say(42));
//! assert_eq!(say_number::say(514), "five hundred and fourteen".to_string());
//! ```

pub mod english;
pub mod french;

/// Says a number in English. **Attention**: in future releases, this function will automatically
/// select the language to use based on the user's setting on his/her machine.
///
/// # Examples
///
/// ```rust
/// assert_eq!(say_number::say(416), "four hundred and sixteen".to_string());
/// assert_eq!(say_number::say(514), "five hundred and fourteen".to_string());
/// ```
#[inline]
pub fn say(n: u64) -> String {
    english::say(n)
}