The string->number function takes an optional radix (which must be
an exact integer, either 2, 8, 10, or 16). If not supplied, it defaults to decimal unless an explicit radix is included in the number string. For example, "#o177" is octal, "#xff" is hexadecimal.
Note that the radix and numbers may be upper or lower case.
Here's an example that accepts a number in either decimal, octal, or hex, and prints that number in all three bases. It uses the oct function to convert from octal and hexadecimal if the input began with a 0. It then uses printf to convert back into hex, octal, and decimal as needed.