Skip to main content
Peter Kahrel
Community Expert
Community Expert
November 3, 2013
Question

JS: Convert Arabic numbers to Hebrew

  • November 3, 2013
  • 3 replies
  • 3598 views

Does anyone know of a function (preferably JavaSript) to convert Arabic numbers to Hebrew?

Thanks,

Peter

This topic has been closed for replies.

3 replies

TᴀW
Legend
November 3, 2013

I don't know of a function, but as it is a little bit complicated, I

would be tempted, if you have the right version of InDesign, to create a

story with a number list using the Hebrew style of your choice, then

convert to text, load it up into an array, and delete.

Otherwise you're going to have to deal with a number of peculiarities

(such as 15 and 16 being represented as 96 and 97 instead of 10+5 and

10+6 to avoid the inadvertent use of the name of God), and so on.

id-extras.com | InDesign tools & scripts for typesetters, form designers, and translators
Peter Kahrel
Community Expert
Community Expert
November 3, 2013

Thanks, Ariel. Odd that there's a built-in conversion function for Farsi, Arabic and Hindi, but not for Hebrew. That would be the ME version, right? I was looking to convert plain Arabic numbers to Hebrew irrespective of the ID version. I found a description of how to do the conversion (http://www.i18nguy.com/unicode/hebrew-numbers.html). It should be possible to script it, but I thought I'd look around for something existing first. Nothing shows up on Google, and I was hoping that you or Harbs might have something.

Peter

TᴀW
Legend
November 3, 2013

Well, I think that Farsi, Hindi and Arabic numbers have a one-to-one

correlation. It's just a question of replacing the glyphs. Hebrew

numbering is not decimal based, so it's more complicated. (Yes, ME

edition, starting in CS6 -- called "transliterate". So you've got

doc.findChangeTransliterateOptions, myText.findTransliterate etc. etc.

It's a new tab in the find/change dialog box.)

id-extras.com | InDesign tools & scripts for typesetters, form designers, and translators
TᴀW
Legend
November 3, 2013

Actually, my question is not so relevant. There is a built-in function

to convert between Farsi, Arabic and Hindi, but not Hebrew, from CS6 up.

id-extras.com | InDesign tools & scripts for typesetters, form designers, and translators
TᴀW
Legend
November 3, 2013

Which version of InDesign?

id-extras.com | InDesign tools & scripts for typesetters, form designers, and translators