Takes a Unicode character (as a string), and returns the corresponding character code, as an integer.

This function can work for ASCII conversions as well, since Unicode and ASCII character codes match for all ASCII characters.

ordinal(string)

  • Parameters

String string - A string containing a single Unicode character. If the string does not contain exactly one character, an ExpressionEval error is thrown.

  • Results

Integer - The character code associated with the Unicode character.

ordinal("a") //Returns 97.
ordinal("AA") //Returns Error_ExpressionEval.
ordinal("ñ") //Returns 241