Lange Posted December 5, 2001 Posted December 5, 2001 Hello Does anybody know if somebody has made a script that converts arabic numbering to roman? (Like 231 = CCXXXI). I have a javascript that does the job but would like to implement it directly in my Filemaker Database, so that when I enter the arabic number (231) the database itself converts it to the corresponding roman number in another field. [ December 05, 2001: Message edited by: Lange ]
BobWeaver Posted December 5, 2001 Posted December 5, 2001 Try this calculation: Choose(Mod(Int(Arabic)/1000, 10), "", "M", "MM","MMM") & Choose(Mod(Int(Arabic)/100, 10), "", "C", "CC","CCC","CD","D","DC","DCC","DCCC","CM") & Choose(Mod(Int(Arabic)/10, 10), "", "X", "XX","XXX","XL","L","LX","LXX","LXXX","XC") & Choose(Mod(Arabic, 10), "", "I", "II","III","IV","V","VI","VII","VIII","IX")
Lange Posted December 6, 2001 Author Posted December 6, 2001 Hi Bob! Cool! Thanx for the inspiration. I could not immediately get it to work, but had to modify the calculation a bit. But now it works like a dream! Here's the modified code. The problem was mainly the commas (,) - they had to be these: ( ";") (The name of my field with the arabic number is "Plate Arabic") - - - - code: Choose(Mod(Int(Plate Arabic)/1000; 10); ""; "M"; "MM";"MMM") & Choose(Mod(Int(Plate Arabic)/100; 10); ""; "C"; "CC";"CCC";"CD";"D";"DC";"DCC";"DCCC";"CM") & Choose(Mod(Int(Plate Arabic)/10; 10); ""; "X"; "XX";"XXX";"XL";"L";"LX";"LXX";"LXXX";"XC") & Choose(Mod(Plate Arabic; 10); ""; "I"; "II";"III";"IV";"V";"VI";"VII";"VIII";"IX") Greetings! [ December 06, 2001: Message edited by: Lange ] [ December 06, 2001: Message edited by: Lange ]
Recommended Posts
This topic is 8392 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