poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 60422] DataFormatter.formatCellValue returns incorrect value for German 'Buchhaltung' format
Date Sat, 24 Jun 2017 00:29:55 GMT
https://bz.apache.org/bugzilla/show_bug.cgi?id=60422

--- Comment #13 from PJ Fanning <fanningpj@yahoo.com> ---
I like Javen's idea of adding something like a LocaleUtil set/getDefaultLocale.

I'm wondering if it would be useful to add extra tests like this sample I just
produced:

    @Test
    public void testDateFormattingWithLocales() {
        // 2017-12-01 09:54:33 which is 42747.412892397523 as double
        DataFormatter dfDE = new DataFormatter(Locale.GERMANY);
        DataFormatter dfZH = new DataFormatter(Locale.PRC);
        DataFormatter dfIE = new DataFormatter(new Locale("GA", "IE"));
        double date = 42747.412892397523;
        String format = "dd MMMM yyyy HH:mm:ss";
        assertEquals("12 Januar 2017 09:54:33",
dfDE.formatRawCellContents(date, -1, format));
        assertEquals("12 \u4E00\u6708 2017 09:54:33",
dfZH.formatRawCellContents(date, -1, format));
        assertEquals("12 Ean\u00E1ir 2017 09:54:33",
dfIE.formatRawCellContents(date, -1, format));
    }

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Mime
View raw message