BigDecimal Error: NumberFormatException [How to Solve]

Question:

1. This problem occurs first because it is not handled properly during type conversion, and non null judgment is required

Solution:

String val =””;

if (val!=null && !val.equals("")){
merchantDetailData.setTransactionAmount(new BigDecimal(StringUtils.nvl(list.get(9))));
}

Only when the judgment value is not equal to null and not equal to “”

Read More: