'Excel Value to BigDecimal

Here's the problem:

I am reading an Excel file that has both strings and numeric values. In my method I parse the respective fields into either BigDecimal or Strings. Now I have a column that contains either strings or a numeric value. When I run the program then a NumberFormatException is thrown.

Does anyone have a solution for me?

Im parsing like follow:

parse.setTotal(new BigDecimal(a.get(6).toString())); --> here is the Value a Stirng or numeric


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source