Allowing input of Arabic numbers and them converting them to an integer

Hi there,

I have an ODK form that is not allowing the enumerator to enter numbers in Arabic (in an 'integer' type). Is there a way to allow Arabic numbers (or 1, 2, 3... if completing the form in English) as text and then convert them to integers? I need an integer for a subsequent calculation field.

I tried translate(${deceased_howmany},"١","1") but could not get it to work. The form is valid but is kicking back a 'length of value too long for field'. I also tried regex() but cannot get it to behave.

Thank you!

I would be so grateful for any help with this.

Hi,

I used translate and int() to convert from Eastern Arabic to a text string and then an integer, and did a calculation with it to confirm it works. If Western Arabic is used, it will be left untouched and also work, as will a mixture. Tested in Enketo & Collect.

My device is set for Western Arabic though, so I don't have a numeric entry appearance with Eastern Arabic numerals to test with - if this is a valid input method. Excel did 'helpfully' try to change my form defaults when I had cells with only Eastern Arabic characters and converted these to numbers that were then shown in Western Arabic when I loaded the form.

translate_arabic_numerals.xls (42.5 KB)

1 Like

OMG...you are a genius. Thank you, that worked!