Crates.io | numerus |
lib.rs | numerus |
version | 0.1.1 |
source | src |
created_at | 2019-09-01 00:53:12.487793 |
updated_at | 2019-09-03 18:48:30.910625 |
description | Convert integers to roman numerals and vice versa |
homepage | |
repository | https://github.com/FilippoRanza/numerus |
max_upload_size | |
id | 161240 |
size | 12,335 |
Convert integers to roman numerals and vice versa
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