Skip to content

donmccaughey/ordo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ordo

Latin language utility library for Rust.

Tests Crates.io docs.rs Crates.io

Contents

Numerus struct

A standard form Roman numeral in the range 1..=3999 (I to MMMCMXCIX).

A Numerus is an integer value type that represents a Roman numeral like XVII or IX. Numeri are unsigned integers with a limited range that display as Roman numerals.

use ordo::Numerus;
use std::convert::TryFrom;
use std::convert::TryInto;

let xxvi = Numerus::try_from(26).unwrap();
let cxi: Numerus = 111.try_into().unwrap();

let lxxxv = cxi - xxvi;
println!("The answer is {}", lxxxv);
// prints "The answer is LXXXV"

License

ordo is made available under a BSD-style license; see the LICENSE file for details.