Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
Solved

# Roman Numeral Conversion

Posted on 2000-02-14
Medium Priority
561 Views
I would like to use a roman numeral as my copyright year.  What is the conversion code I need to use?
0
Question by:tecmaster
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points
1 Comment

LVL 6

Accepted Solution

tecbuilder earned 1600 total points
ID: 2521389
I developed this for a pascal program I wrote quite a while ago and later converted it to JavaScript to convert any integer to Roman Numeral and Roman Numeral to integer.  I believe it will do what you want.

<HTML>
<SCRIPT LANGUAGE="JavaScript">
<!--
function convertInteger(N) {
var valRN = new Array (1,4,5,9,10,40,50,90,100,400,500,900,1000);
var textRN = new Array ("I","IV","V","IX","X","XL","L","XC","C","CD","D","CM","M");
var theValue = "";
while (N > 0) {
i = 12;
while(valRN[i] > N) i--;
numRN = Math.floor(N / valRN[i]);
for (j=1;j<=numRN;j++) theValue += textRN[i];
N = N % valRN[i];
}
return theValue;
}

// -->
</SCRIPT>

<BODY>
<SCRIPT LANGUAGE="JavaScript">
<!--
//-->
</SCRIPT>

</BODY>
</HTML>

tec
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
###### Suggested Courses
Course of the Month11 days, 19 hours left to enroll