Posted 6 months, 3 weeks ago | Originally written on 4 Jul 2020
OK. Quick note. I've just come across a Python package for converting Arabic to Roman numerals. Great! But I think it can be improved in several ways.
- Add documentation even if just in the README file to show how to use it.
- Add an entry point for users to run it in the terminal.
- Extend the range. It currently only does conversions up to 4999. However, one can actually write Roman numerals up to several million (I can't remember the exact bound) using some interesting tricks. An overline provides a thousands multiplier (https://blog.prepscholar.com/roman-numerals-converter). The main challenge here is how to add the overline. My immediate thought was to use a unicode character. However, that falls short quite fast because I don't think there's a V with overline. Anyway, even if there is what you can do is using COMBINING DIACRITICAL MARKS (https://www.unicode.org/charts/nameslist/n_0300.html). Here's some Python code:
In : chr(0x0238)+chr(0x0304)
In : chr(0x0238) #+chr(0x0304)
The basic idea is to append the diacritical mark immediately after whatever symbol you want with an overline. The example above uses the COMBINING MACRON but you can get better results (continuous overline) using the COMBINING OVERLINE like so:
In : 'V'+chr(0x0305)
In : 'I'+chr(0x0305) + 'V'+chr(0x0305)
I plan to add these features to the Python roman package.