Overview
Roman Numeral Converter converts between Arabic numbers and Roman numerals.
ð https://devnestio.pages.dev/roman-numeral/
Features
- Arabic â Roman: supports 1 through 3,999,999
- Roman â Arabic: validates canonical form with round-trip check
- Extended range uses vinculum overline notation (MĖ, DĖ, CĖ)
- Step-by-step breakdown shows each symbol and its contribution
- 13 click-to-load examples
Algorithm
Greedy subtraction from a lookup table:
const ROMAN_MAP = [
[1000000,'MĖ'], [900000,'CĖMĖ'], ..., [900,'CM'], ..., [1,'I']
];
while (rem >= val) { result += sym; rem -= val; }
Validation uses a round-trip check â re-encode the parsed number and compare with input. This rejects non-canonical forms like IIII or VV automatically.
ð Try it: https://devnestio.pages.dev/roman-numeral/
Top comments (0)