JDK-8029207 : There should be a space before % sign in Swedish locale
  • Type: Bug
  • Component: globalization
  • Sub-Component: locale-data
  • Affected Version: 7u45
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: windows_7
  • Submitted: 2013-11-18
  • Updated: 2013-12-11
  • Resolved: 2013-12-11
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.
JDK 8
8Fixed
Related Reports
Duplicate :  
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 :
Use the source code pasted below

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Expected: 50 %
ACTUAL -
Actual:       50%


REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
import java.text.NumberFormat;
import java.util.Locale;

public class SwedishLocale {

    public static void main( String argv[] ) {
        int numerator = 1;
        int denominator = 2;

        Locale english = new Locale( "EN", "US", "" );
        Locale swedish = new Locale( "SV", "SE", "" );

        NumberFormat englishFormatter = NumberFormat.getPercentInstance(english);
        NumberFormat swedishFormatter = NumberFormat.getPercentInstance(swedish);
                
        if (denominator == 0) {
            System.out.println(english + ": " + englishFormatter.format(0));
            System.out.println(swedish + ": " + swedishFormatter.format(0));
        } else {
            System.out.println(english + ": " + englishFormatter.format(numerator/(double)denominator));
            System.out.println(swedish + ": " + swedishFormatter.format(numerator/(double)denominator));
        }
    }
}
---------- END SOURCE ----------
Comments
This is exact duplicate of JDK-8027695.
11-12-2013