You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by Николай Ижиков <ni...@gmail.com> on 2013/09/18 18:19:02 UTC

Possible bug in NumberToTextConverter

Hi, all.

I'm working on some Excel report and found possible bug.

Brief information about my environment:

poi 3.9
jdk 1.6.0_25
Windows 7
Microsoft Office 2007
Russian default locale.

When I create Numeric cell it seems fine, but when I open file in Excel -
it don't recognized as numeric.
My code is:

                    c.setCellValue(new Double(value.first()));
                    c.setCellType(Cell.CELL_TYPE_NUMERIC);

I think it because POI always use '.'(dot char) as decimal separator for
numeric values.
Buy in Russian locale ','(comma) is decimal separator.

So when I patch org.apache.poi.ss.util.NumberToTextConverter class to use
decimal separator from default locale
DecimalFormatSymbols.getInstance().getDecimalSeparator()
it seems fine.

What do you think?

-- 
С уважением, Николай Ижиков
NIzhikov@gmail.com