Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

Roman numeral converter

A tiny demo of the p/moul/x/daily/romannum library — the classic ToRoman / FromRoman kata. Pure and deterministic.

Examples

decimal roman
1 I
4 IV
9 IX
14 XIV
40 XL
49 XLIX
90 XC
400 CD
900 CM
1994 MCMXCIV
2024 MMXXIV
3888 MMMDCCCLXXXVIII
3999 MMMCMXCIX

Try it

  • :/<n> — integer → Roman, e.g. :/2024 → MMXXIV
  • :/r/<roman> — Roman → integer, e.g. :/r/MMXXIV → 2024