Function googology::conway_wechsler::full_name [−][src]
pub fn full_name(digits: &str, scale: Scale) -> Result<String, ParseError>
Gives a full length name for a number represented by an arbitrary sequence of digits.
Arguments
digits
- A string slice that holds a representation of the number using only the digits 0-9. If any other character is present, this function will return an Err.scale
- An enumerated value to determine which scale should be used. Short scales use a new “-illion” name for every power of 1000, while long scales use a new “-illion” name for every power of 1000000.
Example
use googology::conway_wechsler::{Scale, full_name}; let milliard = full_name("19000000042", Scale::LongPeletier).unwrap(); let billion = full_name("19000000042", Scale::Short).unwrap(); assert_eq!("nineteen milliard forty two", milliard.as_str()); assert_eq!("nineteen billion forty two", billion.as_str());