Converts a text representation of a number in a given base into a decimal number