Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Make Page Numbers appear as roman numerals?

Status
Not open for further replies.

LTillner

MIS
Apr 23, 2002
96
US
I need to add page numbers to a text document. Not usually a problem. However, I need the page numbers to appear as ROMAN NUMERALS where 1 = i, 2 = ii, 3 = iii, 4 = iv, etc.

How can I accomplish this?

Thanks for any help!

Lynette
 
You might have to create a formula that does the translation:

select pagenumber
case 1 : " i"
case 2 : " ii"
case 3 : "iii"
case 4 : " iv"
case 5 : " v"
default : ""

-LB
 
Try this
Roman (PageNumber) or if you need Lower Case, then
LCase (Roman (PageNumber)). I am not sure Roman() is there in Crystal 8.5 though.

kutoose@yahoo.com
 
Roman() isn't available in 8.0--I don't know about 8.5.

-LB
 
I adapted this from
Create a formula ("@PageNumbers_Roman") using Basic syntax instead of Crystal syntax, and paste in the following:
Code:
' Formula Name : @PageNumbers_Roman
' Comments : converts a number to Roman numerals 
' Original code from [URL unfurl="true"]http://www.utteraccess.com/forums/access/access330925.html[/URL]
' Uses Basic Syntax

Dim Digits As String
Dim intCounter As Number 
Dim intDigit As Number 
Dim strTmp As String 
Dim intIn As Number

Digits = "ivxlcdm"
'To show them as UpperCase Roman numerals, comment the above line,
'  and uncomment the next
'Digits = "IVXLCDM"
[COLOR=red]intIn = PageNumber[/color]
intCounter = 1 

Do While intIn > 0 

intDigit = intIn Mod 10 
intIn = intIn \ 10 

Select Case intDigit 
Case 1
    strTmp = Mid(Digits, intCounter, 1) & strTmp 
Case 2
    strTmp = Mid(Digits, intCounter, 1) & Mid(Digits, intCounter, 1) & strTmp 
Case 3
     strTmp = Mid(Digits, intCounter, 1) & Mid(Digits, intCounter, 1) & Mid(Digits, intCounter, 1) & strTmp 
Case 4
     strTmp = Mid(Digits, intCounter, 2) & strTmp 
Case 5
     strTmp = Mid(Digits, intCounter + 1, 1) & strTmp 
Case 6
     strTmp = Mid(Digits, intCounter + 1, 1) & Mid(Digits, intCounter, 1) & strTmp 
Case 7
     strTmp = Mid(Digits, intCounter + 1, 1) & Mid(Digits, intCounter, 1) & Mid(Digits, intCounter, 1) & strTmp 
Case 8
     strTmp = Mid(Digits, intCounter + 1, 1) & Mid(Digits, intCounter, 1) & Mid(Digits, intCounter, 1) & Mid(Digits, intCounter, 1) & strTmp 
Case 9
     strTmp = Mid(Digits, intCounter, 1) & Mid(Digits, intCounter + 2, 1) & strTmp 
End Select 

intCounter = intCounter + 2 

Loop 

Formula = strTmp
Tested with CR 8.5.

-dave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top