The io_lib:fread function takes an optional radix (which must be an exact integer, from 2 to 36). If not supplied, it defaults to decimal.

You can provide specific formatting for numbers using the io_lib:format or io:fwrite functions (which use the same syntax): 4> io:fwrite("~.16B\n", [123]).
7B

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.