Slobey Posted December 13, 2006 Share Posted December 13, 2006 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 More sharing options...
efen Posted December 15, 2006 Share Posted December 15, 2006 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 More sharing options...
mr_vodka Posted December 15, 2006 Share Posted December 15, 2006 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 More sharing options...
comment Posted December 16, 2006 Share Posted December 16, 2006 I thought Mike wanted to convert Roman to Arabic: http://www.briandunning.com/cf/85 Link to comment Share on other sites More sharing options...
mr_vodka Posted December 18, 2006 Share Posted December 18, 2006 Hmmm, I must have misread it. Thanks for the followup correction Comment. Link to comment Share on other sites More sharing options...
Recommended Posts
This topic is 6123 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 accountSign in
Already have an account? Sign in here.
Sign In Now