Skip to content

FilippoRanza/numerus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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