NaN and BigDecimal - Invalid conversion.
Brought to you by:
aruckerjones,
sconway
I have a ResultSet that has 1 column (double) and the value is 'NaN'
when sending this ResultSet to the writeAll ResultSetHelperService.getColumnValue tries to use getBigDecimal
BigDecimal cannot hold NaN value within...
Error converting value to BigDecimal.
.....
at au.com.bytecode.opencsv.ResultSetHelperService.getColumnValue(ResultSetHelperService.java:134)
at au.com.bytecode.opencsv.ResultSetHelperService.getColumnValues(ResultSetHelperService.java:60)
at au.com.bytecode.opencsv.CSVWriter.writeAll(CSVWriter.java:206)
I Modified the ResultSetHelperService to handle Float and Double data types as Float and Double instead of BigDecimal so it can now handle NaN, Infinity, and -Infinity.
This is merged in trunk and will be out in the 3.7 release.
I noticed you are using an old version of opencsv so be warned all the packages changed from au.com.bytecode.opencsv to com.opencsv.
:)
awesome! thanks a lot! :)