Converts a number from one base to another.