Package roman
provides functions for converting arabic to roman numerals and back
Needed for a work project, and with the lack of a solution that suited my exact needs, I decided to publish this micro package
$ go get github.com/imbue11235/roman
numeral := roman.FromArabic(4) // => "IV"
numeral := roman.ToArabic("IV") // => 4
- Arabic numerals lower than or equal to
0
cannot be converted and will return an empty string. - Arabic numerals higher than
3999
cannot be converted and will be return an empty string, as:
The largest number that can be represented in this notation is 3,999 (MMMCMXCIX)
This project is licensed under the MIT license.