Roman Numerals

1. Senior Member
Join Date
Dec 1969
Posts
304

## Roman Numerals

Does anyone know if its possible and how to display a number in as asp page in roman numeral format?

2. Senior Member
Join Date
Dec 1969
Posts
314

## RE: Roman Numerals

Just write its character code. chr()

3. Senior Member
Join Date
Dec 1969
Posts
11,247

## RE: Roman Numerals

Ahhh do you want to convert a number to Roman numerals?<BR><BR>Function ConvertToRoman(ByVal Arabic)<BR><BR> Dim Roman : Roman = ""<BR> Dim allRoman, FourRomanChar, RomanPower, RZero, ROne, i<BR><BR> If Arabic &#060; 4000 Then<BR> allRoman = Array("I", "V", "X", "L", "C", "D", "M")<BR> Else<BR> allRoman = Array("i", "v", "x", "l", "c", "d", "m", "V", "X", "L", "C", "D", "M", "V")<BR> End If<BR><BR> For i = UBound(allRoman) To LBound(allRoman) Step -1<BR><BR> RomanPower = (10 ^ (i 2)) * (5 ^ (i Mod 2))<BR> Roman = Roman & String(Arabic RomanPower, allRoman(i))<BR> Arabic = Arabic - (RomanPower * (Arabic RomanPower))<BR><BR> Next<BR><BR> For i = LBound(allRoman) To UBound(allRoman) - 2 Step 2<BR><BR> FourRomanChar = String(4, allRoman(i))<BR><BR> If InStr(1, Roman, FourRomanChar) &#062; 0 Then<BR> RZero = allRoman(i)<BR> ROne = allRoman(i + 1)<BR> Roman = Replace(Roman, ROne & FourRomanChar, RZero & allRoman(i + 1))<BR> Roman = Replace(Roman, FourRomanChar, RZero & ROne)<BR> End If<BR> Next<BR><BR> ConvertToRoman = Roman<BR>End Function<BR>%&#062;

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•