Replaced type-check by simple cast.

According to DecimalFormat's documentation this is correct.