#numeral #systems #roman #modern #ancient #numeric #module

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

#112 in Value formatting

Download history 1442/week @ 2024-06-20 1154/week @ 2024-06-27 1298/week @ 2024-07-04 1414/week @ 2024-07-11 1473/week @ 2024-07-18 1077/week @ 2024-07-25 1385/week @ 2024-08-01 1252/week @ 2024-08-08 1493/week @ 2024-08-15 1458/week @ 2024-08-22 1678/week @ 2024-08-29 1609/week @ 2024-09-05 1414/week @ 2024-09-12 1698/week @ 2024-09-19 1808/week @ 2024-09-26 1462/week @ 2024-10-03

6,584 downloads per month
Used in 52 crates (7 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