Details
-
Bug
-
Resolution: Fixed
-
P3
-
7u45
-
b117
-
windows_7
-
Verified
Backports
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8072296 | 7u85 | Sean Coffey | P3 | Resolved | Fixed | b01 |
JDK-8059224 | 7u80 | Sean Coffey | P3 | Resolved | Fixed | b03 |
JDK-8028887 | port-stage-ppc-aix | Yong Huang | P3 | Resolved | Fixed | master |
Description
FULL PRODUCT VERSION :
java version "1.7.0_45"
Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
Java HotSpot(TM) Client VM (build 24.45-b08, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.1.7601]
A DESCRIPTION OF THE PROBLEM :
The formatting of percents in the Swedish sv_SE locale is incorrect. There should be a space between the number and the percentage symbol.
Actual: 50%
Expected: 50 %
A similar Java bug was fixed for France: bug id 6547501
According to the Swedish Language Council, the percent sign should be preceded by a space in Swedish. ( http://en.wikipedia.org/wiki/Percent_sign )
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
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", "" );
Locale swedish = new Locale( "SV", "SE", "" );
NumberFormat englishFormatter = NumberFormat.getPercentInstance(english);
NumberFormat swedishFormatter = NumberFormat.getPercentInstance(swedish);
NumberFormat frenchFormatter = NumberFormat.getPercentInstance(french);
if (denominator == 0) {
System.out.println(english + ": " + englishFormatter.format(0));
System.out.println(french + ": " + frenchFormatter.format(0));
System.out.println(swedish + ": " + swedishFormatter.format(0));
} else {
System.out.println(english + ": " + englishFormatter.format(numerator/(double)denominator));
System.out.println(french + ": " + frenchFormatter.format(numerator/(double)denominator));
System.out.println(swedish + ": " + swedishFormatter.format(numerator/(double)denominator));
}
}
}
Output:
en_US: 50%
fr_FR: 50 %
sv_SE: 50%
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
sv_SE: 50 %
(see the space between the number and % symbol)
ACTUAL -
sv_SE: 50%
No space
REPRODUCIBILITY :
This bug can be reproduced always.
java version "1.7.0_45"
Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
Java HotSpot(TM) Client VM (build 24.45-b08, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.1.7601]
A DESCRIPTION OF THE PROBLEM :
The formatting of percents in the Swedish sv_SE locale is incorrect. There should be a space between the number and the percentage symbol.
Actual: 50%
Expected: 50 %
A similar Java bug was fixed for France: bug id 6547501
According to the Swedish Language Council, the percent sign should be preceded by a space in Swedish. ( http://en.wikipedia.org/wiki/Percent_sign )
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
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", "" );
Locale swedish = new Locale( "SV", "SE", "" );
NumberFormat englishFormatter = NumberFormat.getPercentInstance(english);
NumberFormat swedishFormatter = NumberFormat.getPercentInstance(swedish);
NumberFormat frenchFormatter = NumberFormat.getPercentInstance(french);
if (denominator == 0) {
System.out.println(english + ": " + englishFormatter.format(0));
System.out.println(french + ": " + frenchFormatter.format(0));
System.out.println(swedish + ": " + swedishFormatter.format(0));
} else {
System.out.println(english + ": " + englishFormatter.format(numerator/(double)denominator));
System.out.println(french + ": " + frenchFormatter.format(numerator/(double)denominator));
System.out.println(swedish + ": " + swedishFormatter.format(numerator/(double)denominator));
}
}
}
Output:
en_US: 50%
fr_FR: 50 %
sv_SE: 50%
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
sv_SE: 50 %
(see the space between the number and % symbol)
ACTUAL -
sv_SE: 50%
No space
REPRODUCIBILITY :
This bug can be reproduced always.
Attachments
Issue Links
- backported by
-
JDK-8028887 There should be a space before % sign in Swedish locale
- Resolved
-
JDK-8059224 There should be a space before % sign in Swedish locale
- Resolved
-
JDK-8072296 There should be a space before % sign in Swedish locale
- Resolved
- duplicates
-
JDK-8029207 There should be a space before % sign in Swedish locale
- Closed
- relates to
-
JDK-8037111 space before % is inconsistent between sv and sv_SE
- Resolved