Jump to content

Converting Roman numerals


This topic is 6329 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Hi gang,

I am creating a table of contents for chapters in a book. I have 3 tables, book, chapter, page. in the chapter table I have a field that uses the min function to find the first page of that chapter from the page table. the problem I have is that the book has a preface and a forward which have roman numeral page numbers. Is there a simple way to convert them?

Mike

Link to comment
Share on other sites

A calculation to convert the Roman Numeral numbers I to XXXV

Roman (Text field)

Number (Calculation field, Number result)

= If (Position (Roman, "IX", 1), 9+Length (Roman)*10–20, If (Position (Roman, "IV", 1), 4+Length (Roman)*10–20, If (Right (Roman, 1) = "X", 10*Length (Roman), If (Right (Roman, 1)="V", 5+(Length (Roman)*10–10), If (Left (Roman, 3) = "XXX", 30+(Length (Roman)–3), If (Left (Roman, 2)="XX", 20+If (Position (Roman, "V", 1), 4, 0)+(Length (Roman)–2), If (Left (Roman, 1)="X", 11+If (Position (Roman, "V", 1), 4, 0)+(Length (Roman)–2), If (Left (Roman, 1)="V", 5, 1)+(Length (Roman)–1)))))))) *

Link to comment
Share on other sites

You can take a look at this custom function and tweak it to a field value rather than Get(PageNumber) if you needs custom number conversion.

http://www.briandunning.com/cf/21

Link to comment
Share on other sites

This topic is 6329 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.