#numeric #systems #numerals #modern #formats

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
Download history 16/week @ 2020-07-22 11/week @ 2020-07-29 20/week @ 2020-08-05 35/week @ 2020-08-12 34/week @ 2020-08-19 34/week @ 2020-08-26 62/week @ 2020-09-02 47/week @ 2020-09-09 30/week @ 2020-09-16 44/week @ 2020-09-23 53/week @ 2020-09-30 35/week @ 2020-10-07 37/week @ 2020-10-14 28/week @ 2020-10-21 56/week @ 2020-10-28 101/week @ 2020-11-04

126 downloads per month
Used in 7 crates (5 directly)

MIT license

12KB
254 lines

rust-numerals numerals on crates.io 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