My implementation of Roman numerals

I made some blocks that convert Arabic numerals to/from Roman numerals. Converting Roman numerals to Arabic numerals was fairly simple, while going the other way around needed a bit more brainstorming because of numbers like IV. Anyway here it is:

If there is anything wrong with the algorithm I would like to know.

(P.S. what does untitled script pic (1) do?)

This is really cool, good job!
This can also be used to simplify roman numerals, I found, if you nest both the blocks in each other.

1999 >> MIM seems to be in strange "Irregular subtractive notation"
MCMXCIX is expected.

Where did you find that? It's another name in the literature for COMBINE.

I remembered in the old site there was an example project about Roman numerals by jens. The code included that block. It doesn't seem to work the exact same way the combine block does though.

That's weird. I wonder what it does.

Oh. Well I learned Roman numerals in elementary but have seldom used them ever since so I forgot some of it. I think if a lesser number a preceded a greater number b, then it would add b - a. Or does it subtract the total from b?

You don't have the order wrong; it does what you said, b-a. But only certain combinations of A and B are allowed. Typically A has to be the power of ten closest to B but below it. So, CM, not XM or IM. (And not VM or LM or DM because those aren't powers of ten.)

Every digit is calculated in isolation and with no more than 4 symbols. So
9 is encoded as IX, not VIIII.


Thousands	Hund.	Tens	Units
1	M		C		X		I
2	MM		CC		XX		II
4			CD		XL		IV
5			D		L		V
6			DC		LX		VI
9			CM		XC		IX

Evidently you need to allow space for 3 inputs. Try doing that.