[][src]Function numerus::numerus_lib::int_to_roman::int_to_roman_upper

pub fn int_to_roman_upper(number: i32) -> Option<String>

Convert the given numer into an uppercase roman numeral. This function fails if the given numer is not representable in the roman numerical system (i.e. number <= 0).

An error example

    use numerus::int_to_roman_upper;
     
    /*
      there's no representation for 0 
      in the roman numerical system
    */
    let wrong_number = 0;
    match int_to_roman_upper(wrong_number) {
        Some(_) => assert!(false),
        None => assert!(true)
    };

A correct convertion

    use numerus::int_to_roman_upper;
 
    let convertible_number = 101;
    match int_to_roman_upper(convertible_number) {
        Some(roman) => assert_eq!(roman, "CI"),
        None => assert!(false)
    };