I want to parse a double comma as a decimal separator (',' instead of '.') Using SuperCSV CellProcessor
I want to parse the first element (0.35) on Double
0,35;40000,45
I tried something like this:
private static final DecimalFormatSymbols FRENCH_SYMBOLS = new DecimalFormatSymbols(Locale.FRANCE); DecimalFormat df = new DecimalFormat(); df.setDecimalFormatSymbols(FRENCH_SYMBOLS); final CellProcessor[] processors = new CellProcessor[] { new NotNull(new ParseDouble(new FmtNumber(df))), new NotNull(new ParseBigDecimal(FRENCH_SYMBOLS)) };
ParseBigDecimal works fine, but parseDouble doesn't seem to work, it gives me an exception: org.supercsv.exception.SuperCsvCellProcessorException: '0.35' cannot be parsed as Double
source share