Jump to content

Convert arabic to roman numbers?


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

Recommended Posts

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 ]

Link to comment
Share on other sites

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")

Link to comment
Share on other sites

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 ]

Link to comment
Share on other sites

This topic is 7255 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
 Share

×
×
  • Create New...

Important Information

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