* Converts a decimal character code to its decimal value.
(charCode: number)
| 115 | * Converts a decimal character code to its decimal value. |
| 116 | */ |
| 117 | function decimalCharCodeToNumber(charCode: number): number { |
| 118 | // Check if the character code is in the range for '0' to '9' |
| 119 | if (0x30 <= charCode && charCode <= 0x39) return charCode - 0x30; // Convert '0'-'9' to 0-9 |
| 120 | return -1; |
| 121 | } |
| 122 | |
| 123 | /** |
| 124 | * Converts a Unicode code point to a string. |