My roman numeral function library contains three functions:
The conversion function outputs in subtractive notation by default, which was the standardized method during the Middle Ages. In ancient times, the Romans preferred the expanded notation, as can be seen from the door numberings on the Coliseum.
The expansion and contraction functions, besides being useful to suit your personal style, are also needed for performing mathematical operations on Roman numerals, which is left as an exercise to the reader. Alternatively, you may find it easier to write a function to convert from Roman to Arabic and do math the normal way.