Skip to content

Latest commit

 

History

History
24 lines (17 loc) · 686 Bytes

README.md

File metadata and controls

24 lines (17 loc) · 686 Bytes

numerus

Build Status crates.io

Convert integers to roman numerals and vice versa

Examples

Convert from int to roman numeral.

    use numerus::int_to_roman_upper;
    let a = 14;
    assert_eq!(int_to_roman_upper(a).unwrap(), "XIV");

Convert a roman numeral to int

    use numerus::roman_to_int;
    let year = "MCMXCVIII";
    assert_eq!(roman_to_int(year).unwrap(), 1998);

For more examples see the documentaion