Function french_numbers::french_number [] [src]

pub fn french_number<N: Integer + FromPrimitive + ToPrimitive + Display>(
    n: &N
) -> String

Compute the French language representation of the given number.

If the number is too large (greater than 10103), then its numerical representation is returned with a leading minus sign if needed.

By default, the masculine declination is used, as well as the preferred orthographic form introduced in the 1990 reform (use hyphens everywhere). See french_number_options if you wish to change either of those options.

Example

use french_numbers::french_number;

assert_eq!(french_number(&71), "soixante-et-onze");
assert_eq!(french_number(&1001), "mille-un");
assert_eq!(french_number(&-200001), "moins deux-cent-mille-un");
assert_eq!(french_number(&-200000001), "moins deux-cents-millions-un");
assert_eq!(french_number(&-204000001), "moins deux-cent-quatre-millions-un");