Fixed possible NumberFormatException

Fixed possible NumberFormatException during rounding of numbers when
given invalid input.