--- title: "ordinal" description: "Takes a Unicode character (as a string), and returns the corresponding character code, as an integer." --- # ordinal > Takes a Unicode character (as a string), and returns the corresponding character code, as an integer. **This function is used by Ignition's Expression language.** ## Description :::note This function can work for ASCII conversions as well, since Unicode and ASCII character codes match for all ASCII characters. ::: ## Syntax `ordinal(string)` ### Parameters | Type | Parameter | Description | |---|---|---| | 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. ## Examples ```python title="Code Snippet" ordinal("a") //Returns 97. ``` ```python title="Code Snippet" ordinal("AA") //Returns Error_ExpressionEval. ``` ```python title="Code Snippet" ordinal("ñ") //Returns 241 ```