Method and source check
Last checked:
Automated source and implementation review, including worked examples and documented numerical limits. This review does not provide professional advice or specialist approval.
Method
Convert valid canonical Roman numeral strings to integers, or whole numbers 1β3999 to standard Roman notation. Trim whitespace and normalize Roman input to uppercase before validation and conversion.
IV = 5 β 1 = 4
MMXXIV = 2024
Variables and units
- number
- integer 1β3999
- Roman numeral
- canonical symbols I,V,X,L,C,D,M
Worked example
2024 converts to MMXXIV, and IV converts to 4.
Limitations
No rounding; only whole numbers from 1 through 3999 and valid canonical Roman strings are accepted.
- 1β3999 is this converterβs supported range, not a universal limit on historic notation.
- 2024 β MMXXIV
- IV β 4
- IC and 4.5 rejected
- Whitespace around " IV " is normalized and returns 4; all 3,999 supported integers round-trip through canonical Roman forms.