Alpha = M,CM,D,CD,C,XC,L,XL,X,IX,V,IV,I Numeric = 1000,900,500,400,100,90,50,40,10,9,5,4,1 StringSplit, Alpha, Alpha, `, Num = 3999 RomanString = Loop, Parse, Numeric, `, { Count := A_Index TempVar := Num // A_LoopField Num -= TempVar * A_LoopField Loop, %TempVar% RomanString .= Alpha%Count% } MsgBox, %RomanString%
It is in reality only accurate to 3999, because after that, the 'M' should have a bar over it, instead of 'MMMM'. I hope someone finds it useful.