Simple JavaScript function that converts Arabic to Roman numbers
Function supports numbers up to 39999. The function can be easily extended to support even bigger numbers.
The symbols for 5000 and 10000 are not pure alphabetic characters, so I used lower case v and x.
Roman numerals:
I = 1
V = 5
X = 10
L = 50
C = 100
D = 500
M = 1000
v = 5000
x = 10000
USAGE
convertToRoman(39); // returns 'XXXIX'