#numeral #systems #modern #roman #ancient #format #numeric

numerals

Library for numeric systems, both ancient and modern

5 releases

Uses old Rust 2015

0.1.4 Apr 25, 2020
0.1.3 Apr 7, 2020
0.1.2 Mar 10, 2018
0.1.1 Sep 25, 2016
0.1.0 May 29, 2015

#4 in #roman

Download history 1141/week @ 2024-01-14 1366/week @ 2024-01-21 1030/week @ 2024-01-28 1045/week @ 2024-02-04 1479/week @ 2024-02-11 1021/week @ 2024-02-18 1189/week @ 2024-02-25 1454/week @ 2024-03-03 2171/week @ 2024-03-10 1648/week @ 2024-03-17 1241/week @ 2024-03-24 1214/week @ 2024-03-31 1095/week @ 2024-04-07 1030/week @ 2024-04-14 974/week @ 2024-04-21 1079/week @ 2024-04-28

4,343 downloads per month
Used in 36 crates (6 directly)

MIT license

13KB
254 lines

rust-numerals Build Status

This is a library for various numeric systems, including ancient, modern, and just plain strange.

Although the Roman module is likely to be the most popular, I maintain an interest in the others, so they’re all packaged as one!

View the Rustdoc

Installation

This library works with Cargo. Add the following to your Cargo.toml dependencies section:

[dependencies]
numerals = "0.1"

The earliest version of Rust that this crate is tested against is Rust v1.31.0.

Roman Numerals

To format a number as Roman numerals, use Roman::from to convert it, and the UpperHex formatting trait to format it.

use numerals::roman::Roman;

let string = format!("{:X}", Roman::from(134));
assert_eq!(string, "CXXXIV");

No runtime deps