13 releases

0.2.1 Jun 19, 2026
0.2.0 Jun 3, 2026
0.1.6 Sep 11, 2017
0.1.5 May 14, 2015
0.0.4 Mar 29, 2015

#733 in Text processing

Download history 307/week @ 2026-04-14 436/week @ 2026-04-21 312/week @ 2026-04-28 664/week @ 2026-05-05 718/week @ 2026-05-12 288/week @ 2026-05-19 270/week @ 2026-05-26 199/week @ 2026-06-02 169/week @ 2026-06-09 184/week @ 2026-06-16 249/week @ 2026-06-23 229/week @ 2026-06-30 249/week @ 2026-07-07 260/week @ 2026-07-14 236/week @ 2026-07-21 404/week @ 2026-07-28

1,221 downloads per month
Used in 2 crates

MIT license

6KB
110 lines

roman

CI crates.io docs.rs license

A Rust library to convert between integers and roman numerals.

Usage

Add to Cargo.toml:

[dependencies]
roman = "0.2"
assert_eq!(roman::to(14),        Some("XIV".to_string()));
assert_eq!(roman::from("XIV"),   Some(14));
assert_eq!(roman::to(0),         None);  // out of range
assert_eq!(roman::from("XIIII"), None);  // non-canonical

assert_eq!(roman::to_lower(14),      Some("xiv".to_string()));
assert_eq!(roman::from_lower("xiv"), Some(14));

Valid range: 1 to roman::MAX (3999). Both functions return None outside that range. from rejects non-canonical forms (e.g. IIII instead of IV).

No runtime deps