Brian Dunning's FileMaker Custom Functions

RomanNumerals ( PageNumber )

Convert a page number to Roman Numeral format. (Text Result)

  Average rating: 4.4 (34 votes) Log in to vote

Don Wieland   Don Wieland - Show more from this author
DW Data Concepts
http://dwdataconcepts.com

Share on Facebook Share on Twitter

  Sample input:
RomanNumerals ( 4 )
  Sample output:
IV

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

Convert the current page number to Roman Numeral format.

 

Comments

Andy Frazier   Andy Frazier, Mx4Px
Oct 14, 2016
As written, only goes up to 999. This will get it up to a million (by adding "M" and the overbar symbols for 5K+). Could keep going, but it's surprisingly hard to find RN equivalents of 5 million and up!!:
Case(
PN>1000000;"A million or less, please";
PN=1000000;Char(77300077);
Choose(Right(Int(PN/100000);1);"";Char(77300067);Char(77300067)&Char(77300067);Char(77300067)&Char(77300067)&Char(77300067);Char(77300067)&Char(77300076);Char(77300068);Char(77300068)&Char(77300067);Char(77300068)&Char(77300067)&Char(77300067);Char(77300068)&Char(77300067)&Char(77300067)&Char(77300067);Char(77300067)&Char(77300077))&
Choose(Right(Int(PN/10000);1);"";Char(77300088);Char(77300088)&Char(77300088);Char(77300088)&Char(77300088)&Char(77300088);Char(77300088)&Char(77300076);Char(77300076);Char(77300076)&Char(77300088);Char(77300076)&Char(77300088)&Char(77300088);Char(77300076)&Char(77300088)&Char(77300088)&Char(77300088);Char(77300088)&Char(77300067))&
Choose(Right(Int(PN/1000);1);
"";"M";"MM";"MMM";"M"&Char(77300086);Char(77300086);Char(77300086)&"M";Char(77300086)&"MM";Char(77300086)&"MMM";"M"&Char(77300088))&
Choose(Right(Int(PN/100);1);
"";"C"; "CC";"CCC";"CD";"D";"DC";"DCC";"DCCC";"CM") &
Choose(Right(Int(PN/10);1);
"";"X";"XX";"XXX";"XL";"L";"LX";"LXX";"LXXX";"XC") &a
 

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 20 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth: