#numeral #roman #convert #prelude #represents

romans

Utility to convert and represent Roman numerals

1 unstable release

0.1.0 Aug 5, 2024

#156 in Value formatting

Download history 103/week @ 2024-08-01 18/week @ 2024-08-08

121 downloads per month

Custom license

23KB
367 lines

romans

A roman numeral convertor

Example

use romans::prelude::*;

fn main() -> Result<()> {
    assert_eq!(123, Numeral::try_from("cxxiii")?.value());
    assert_eq!(
        "cxxiii",
        Numeral::from(123)
            .as_string()
            .to_lowercase()
    );
    Ok(())
}

lib.rs:

Romans

This crate is an utility to convert and represent Roman numerals.

Example

use romans::prelude::*;

assert_eq!(123, Numeral::try_from("cxxiii").unwrap().value());
assert_eq!("CXXIII", Numeral::from(123).as_string());

Dependencies

~265–720KB
~17K SLoC