项目作者: FilippoRanza

项目描述 :
Convert integers to roman numerals and vice versa
高级语言: Rust
项目地址: git://github.com/FilippoRanza/numerus.git
创建时间: 2019-08-31T21:23:53Z
项目社区:https://github.com/FilippoRanza/numerus

开源协议:MIT License

下载


numerus

Build Status crates.io

Convert integers to roman numerals and vice versa

Examples

Convert from int to roman numeral.

  1. use numerus::int_to_roman_upper;
  2. let a = 14;
  3. assert_eq!(int_to_roman_upper(a).unwrap(), "XIV");

Convert a roman numeral to int

  1. use numerus::roman_to_int;
  2. let year = "MCMXCVIII";
  3. assert_eq!(roman_to_int(year).unwrap(), 1998);

For more examples see the documentaion