JDK-4494727 : [Fmt-Nu] Formatting of percents incorrect for some locales
  • Type: Bug
  • Component: globalization
  • Sub-Component: translation
  • Affected Version: 1.4.0,6
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic,windows_vista
  • CPU: generic,x86
  • Submitted: 2001-08-21
  • Updated: 2008-02-14
  • Resolved: 2008-02-14
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other JDK 6 JDK 7
5.0u12Fixed 6u10 b12Fixed 7Fixed
Related Reports
Duplicate :  
Relates :  
Relates :  
Description
Name: ddT132432			Date: 08/21/2001


java version "1.4.0-internal"
java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-B)
Java HotSpot(TM) Client VM (build 1.3.0-B, mixed mode)

(The following information comes from IBM NLDG.)

The most common symbol used to indicate percent is %, as in 37%.
Brazil, Iceland, Israel, South Africa, and Switzerland prefer no space between
the number and the symbol, as follows: 37%.
The Dutch language as used in Belgium and the Netherlands sometimes uses pct
(as in 37 pct) to represent percentages.
In the Canadian province of Qu?bec, the number and symbol is written as 37 %,
with a space in between.
In Turkey, the percent symbol is written before the number: %37.
In some countries using Arabic script, 37 % may also be written using arabic
characters for the percent and numerals, e.g. \u066a\u0663\u0667

However, both JDK 1.3 and JDK1.4 beta return the same text for all supported
locales.  For example, the following code returns '12%' regardless of locale.

----- PercentTest.java -----

import java.text.*;
import java.util.*;

public class PercentTest {
    public static void main(String[] args) {
	Locale locale[] = NumberFormat.getAvailableLocales();
	for (int i = 0; i < locale.length; i++) {
            System.out.println(locale[i].toString()+"("+locale[i].getDisplayCountry()+")"+"-->"+NumberFormat.getPercentInstance(locale[i]).format(0.1234));
	}
    }
}

----- end -----
(Review ID: 130424) 
======================================================================

Comments
EVALUATION de_CH verified with http://unicode.org/cldr/repository/common/main/de.xml?rev=1.99&content-type=text/vnd.viewcvs-markup The file http://unicode.org/cldr/repository/common/main/de_CH.xml?rev=1.50&content-type=text/vnd.viewcvs-markup does not contain specification for percent format so it inherits from de.xml.
11-01-2008

EVALUATION fr_CA already fixed as a part of 6547501.
11-01-2008

EVALUATION Reference for Turkey: http://unicode.org/cldr/repository/common/main/tr.xml?rev=1.91&content-type=text/vnd.viewcvs-markup
11-01-2008

EVALUATION Because no qualified reference found for nl the percentage format will stay as is.
05-12-2006

EVALUATION Looking into a current implementation and found that: - Brazil, Iceland, Israel, South Africa and Switzerland use no space between number and %, no fix required. - nl_BE and nl_NL requires fix: "#.##0%" -> "#.##0 pct" - Canadian province Quebec: fr_CA "#��##0%" -> "#��##0 %", verified with documents from http://www.gouv.qc.ca/portail/quebec/ - Turkey requires fix: "#.##0%" -> "%#.##0" - for arabic formats will stay as is. Need to improve the arabic digit handling first. Do fixes in j2se:src/share/classes/sun/text/resources/FormatData respective files.
27-10-2006

EVALUATION This seems to be a localization bug. Transfer to the L10N team.
04-10-2006

WORK AROUND Name: ddT132432 Date: 08/21/2001 None, except to code the result yourself. ======================================================================
06-08-2004