I want a Label to display Integer as 999,999,999 but it's not happening.

Basic problem is inside IntegerConverter, NumberFormat is created in
abstractIntegerConverter like this:

    public NumberFormat getNumberFormat(Locale locale)
    {
        NumberFormat numberFormat = (NumberFormat)numberFormats.get(locale);
        if (numberFormat == null)
        {
            numberFormat = NumberFormat.getIntegerInstance(locale);
            numberFormat.setParseIntegerOnly(true);
            numberFormat.setGroupingUsed(false);                     //
<<<<<<<<<<<<<<<< !!! why set to false?
            numberFormats.put(locale, numberFormat);
        }
        return (NumberFormat)numberFormat.clone();
    }


Because setGroupingUsed(false), IntegerConverter cannot parse locale
formatted input like "999,999"(raise conversion exception) or output in
locale specific format. DecimalConverter is not like this.

Is there some specific reason to call setGroupingUsed(false)?  Can we have
this remove?

Reply via email to