I think this should use the achar() intrinsic instead. In cases where it matters, you want the native translation of the ascii characters here, not the raw native characters.
Or, another approach might be something like
char(mod(i/100,10)+ichar('0'))
This assumes only that the digits are contiguous within the native character set.
Otherwise, this is a nice trick to generate multidigit integers in strings. ![]()