-
Bug
-
Resolution: Fixed
-
P4
-
5.0u11
-
b01
-
x86
-
windows_xp
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2149737 | 7 | Jiri Tusla | P4 | Closed | Fixed | b18 |
JDK-2148891 | 5.0u14 | Jiri Tusla | P3 | Resolved | Fixed | b01 |
J2SE Version (please include all output from java -version flag):
V:\>java -version
java version "1.5.0_11"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_11-b03)
Java HotSpot(TM) Client VM (build 1.5.0_11-b03, mixed mode)
Does this problem occur on J2SE 1.4.x or 5.0.x ?
Yes (5.0.x)
Operating System Configuration Information (be specific):
Win XP Pro, Redhat5
Hardware Configuration Information (be specific):
N/A
Bug Description:
Using NumberFormat.getPercentageInstance() with a french locale will output the percentage and the %, but there is no space between them. Our localization team indicated that, for example, "50%" should be displayed as "50 %" in french locales.
Steps to Reproduce (be specific):
(CODE)
import java.text.NumberFormat;
import java.util.Locale;
public class TestLocale {
public static void main( String argv[] ) {
int numerator = 1;
int denominator = 2;
Locale english = new Locale( "EN", "US", "" );
Locale french = new Locale( "FR", "FR", "" );
NumberFormat englishFormatter = NumberFormat.getPercentInstance(english);
NumberFormat frenchFormatter = NumberFormat.getPercentInstance(french);
if (denominator == 0) {
System.out.println(english + ": " + englishFormatter.format(0));
System.out.println(french + ": " + frenchFormatter.format(0));
} else {
System.out.println(english + ": " + englishFormatter.format(numerator/(double)denominator));
System.out.println(french + ": " + frenchFormatter.format(numerator/(double)denominator));
}
}
}
(OUTPUT)
en_US: 50%
fr_FR: 50%
V:\>java -version
java version "1.5.0_11"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_11-b03)
Java HotSpot(TM) Client VM (build 1.5.0_11-b03, mixed mode)
Does this problem occur on J2SE 1.4.x or 5.0.x ?
Yes (5.0.x)
Operating System Configuration Information (be specific):
Win XP Pro, Redhat5
Hardware Configuration Information (be specific):
N/A
Bug Description:
Using NumberFormat.getPercentageInstance() with a french locale will output the percentage and the %, but there is no space between them. Our localization team indicated that, for example, "50%" should be displayed as "50 %" in french locales.
Steps to Reproduce (be specific):
(CODE)
import java.text.NumberFormat;
import java.util.Locale;
public class TestLocale {
public static void main( String argv[] ) {
int numerator = 1;
int denominator = 2;
Locale english = new Locale( "EN", "US", "" );
Locale french = new Locale( "FR", "FR", "" );
NumberFormat englishFormatter = NumberFormat.getPercentInstance(english);
NumberFormat frenchFormatter = NumberFormat.getPercentInstance(french);
if (denominator == 0) {
System.out.println(english + ": " + englishFormatter.format(0));
System.out.println(french + ": " + frenchFormatter.format(0));
} else {
System.out.println(english + ": " + englishFormatter.format(numerator/(double)denominator));
System.out.println(french + ": " + frenchFormatter.format(numerator/(double)denominator));
}
}
}
(OUTPUT)
en_US: 50%
fr_FR: 50%
- backported by
-
JDK-2148891 There should be a space before % sign in French locale
- Resolved
-
JDK-2149737 There should be a space before % sign in French locale
- Closed
- relates to
-
JDK-4494727 [Fmt-Nu] Formatting of percents incorrect for some locales
- Resolved
-
JDK-2149452 [Fmt-Nu] Formatting of percents incorrect for some locales
- Closed