Char to num function referenced by the previous code.