function IntToRoman(Value: LongInt): String;
const
Arabics: Array[1..13] of Integer =
(1,4,5,9,10,40,50,90,100,400,500,900,1000);
Romans: Array[1..13] of String =
('I','IV','V','IX','X','XL','L','XC','C','CD','D','CM','M');
var
i: Integer;
begin
for i := 13 downto 1 do
while (Value >= Arabics[i]) do begin
Value := Value - Arabics[i];
Result := Result + Romans[i];
end;
end;