Converts a binary number to a decimal