Java Code Examples for java.text.DecimalFormatSymbols#getZeroDigit()

The following examples show how to use java.text.DecimalFormatSymbols#getZeroDigit() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DecimalStyle.java    From j2objc with Apache License 2.0 5 votes vote down vote up
private static DecimalStyle create(Locale locale) {
    DecimalFormatSymbols oldSymbols = DecimalFormatSymbols.getInstance(locale);
    char zeroDigit = oldSymbols.getZeroDigit();
    char positiveSign = '+';
    char negativeSign = oldSymbols.getMinusSign();
    char decimalSeparator = oldSymbols.getDecimalSeparator();
    if (zeroDigit == '0' && negativeSign == '-' && decimalSeparator == '.') {
        return STANDARD;
    }
    return new DecimalStyle(zeroDigit, positiveSign, negativeSign, decimalSeparator);
}
 
Example 2
Source File: DecimalStyle.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private static DecimalStyle create(Locale locale) {
    DecimalFormatSymbols oldSymbols = DecimalFormatSymbols.getInstance(locale);
    char zeroDigit = oldSymbols.getZeroDigit();
    char positiveSign = '+';
    char negativeSign = oldSymbols.getMinusSign();
    char decimalSeparator = oldSymbols.getDecimalSeparator();
    if (zeroDigit == '0' && negativeSign == '-' && decimalSeparator == '.') {
        return STANDARD;
    }
    return new DecimalStyle(zeroDigit, positiveSign, negativeSign, decimalSeparator);
}
 
Example 3
Source File: Formatter.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private char getZero(Locale l) {
    if ((l != null) &&  !l.equals(locale())) {
        DecimalFormatSymbols dfs = DecimalFormatSymbols.getInstance(l);
        return dfs.getZeroDigit();
    }
    return zero;
}
 
Example 4
Source File: Formatter.java    From j2objc with Apache License 2.0 5 votes vote down vote up
private static char getZero(Locale l) {
    if ((l != null) && !l.equals(Locale.US)) {
        DecimalFormatSymbols dfs = DecimalFormatSymbols.getInstance(l);
        return dfs.getZeroDigit();
    } else {
        return '0';
    }
}
 
Example 5
Source File: Formatter.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
private static char getZero(Locale l) {
    if ((l != null) && !l.equals(Locale.US)) {
        DecimalFormatSymbols dfs = DecimalFormatSymbols.getInstance(l);
        return dfs.getZeroDigit();
    } else {
        return '0';
    }
}
 
Example 6
Source File: Formatter.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private static char getZero(Locale l) {
    if ((l != null) && !l.equals(Locale.US)) {
        DecimalFormatSymbols dfs = DecimalFormatSymbols.getInstance(l);
        return dfs.getZeroDigit();
    } else {
        return '0';
    }
}
 
Example 7
Source File: Formatter.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
private char getZero(Locale l) {
    if ((l != null) &&  !l.equals(locale())) {
        DecimalFormatSymbols dfs = DecimalFormatSymbols.getInstance(l);
        return dfs.getZeroDigit();
    }
    return zero;
}
 
Example 8
Source File: Formatter.java    From Java8CN with Apache License 2.0 5 votes vote down vote up
private char getZero(Locale l) {
    if ((l != null) &&  !l.equals(locale())) {
        DecimalFormatSymbols dfs = DecimalFormatSymbols.getInstance(l);
        return dfs.getZeroDigit();
    }
    return zero;
}
 
Example 9
Source File: Formatter.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private char getZero(Locale l) {
    if ((l != null) &&  !l.equals(locale())) {
        DecimalFormatSymbols dfs = DecimalFormatSymbols.getInstance(l);
        return dfs.getZeroDigit();
    }
    return zero;
}
 
Example 10
Source File: DecimalStyle.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
private static DecimalStyle create(Locale locale) {
    DecimalFormatSymbols oldSymbols = DecimalFormatSymbols.getInstance(locale);
    char zeroDigit = oldSymbols.getZeroDigit();
    char positiveSign = '+';
    char negativeSign = oldSymbols.getMinusSign();
    char decimalSeparator = oldSymbols.getDecimalSeparator();
    if (zeroDigit == '0' && negativeSign == '-' && decimalSeparator == '.') {
        return STANDARD;
    }
    return new DecimalStyle(zeroDigit, positiveSign, negativeSign, decimalSeparator);
}
 
Example 11
Source File: Formatter.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private static char getZero(Locale l) {
    if ((l != null) && !l.equals(Locale.US)) {
        DecimalFormatSymbols dfs = DecimalFormatSymbols.getInstance(l);
        return dfs.getZeroDigit();
    } else {
        return '0';
    }
}
 
Example 12
Source File: DecimalStyle.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
private static DecimalStyle create(Locale locale) {
    DecimalFormatSymbols oldSymbols = DecimalFormatSymbols.getInstance(locale);
    char zeroDigit = oldSymbols.getZeroDigit();
    char positiveSign = '+';
    char negativeSign = oldSymbols.getMinusSign();
    char decimalSeparator = oldSymbols.getDecimalSeparator();
    if (zeroDigit == '0' && negativeSign == '-' && decimalSeparator == '.') {
        return STANDARD;
    }
    return new DecimalStyle(zeroDigit, positiveSign, negativeSign, decimalSeparator);
}
 
Example 13
Source File: DecimalStyle.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private static DecimalStyle create(Locale locale) {
    DecimalFormatSymbols oldSymbols = DecimalFormatSymbols.getInstance(locale);
    char zeroDigit = oldSymbols.getZeroDigit();
    char positiveSign = '+';
    char negativeSign = oldSymbols.getMinusSign();
    char decimalSeparator = oldSymbols.getDecimalSeparator();
    if (zeroDigit == '0' && negativeSign == '-' && decimalSeparator == '.') {
        return STANDARD;
    }
    return new DecimalStyle(zeroDigit, positiveSign, negativeSign, decimalSeparator);
}
 
Example 14
Source File: Formatter.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
private char getZero(Locale l) {
    if ((l != null) &&  !l.equals(locale())) {
        DecimalFormatSymbols dfs = DecimalFormatSymbols.getInstance(l);
        return dfs.getZeroDigit();
    }
    return zero;
}
 
Example 15
Source File: Formatter.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
private static char getZero(Locale l) {
    if ((l != null) && !l.equals(Locale.US)) {
        DecimalFormatSymbols dfs = DecimalFormatSymbols.getInstance(l);
        return dfs.getZeroDigit();
    } else {
        return '0';
    }
}
 
Example 16
Source File: DecimalStyle.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
private static DecimalStyle create(Locale locale) {
    DecimalFormatSymbols oldSymbols = DecimalFormatSymbols.getInstance(locale);
    char zeroDigit = oldSymbols.getZeroDigit();
    char positiveSign = '+';
    char negativeSign = oldSymbols.getMinusSign();
    char decimalSeparator = oldSymbols.getDecimalSeparator();
    if (zeroDigit == '0' && negativeSign == '-' && decimalSeparator == '.') {
        return STANDARD;
    }
    return new DecimalStyle(zeroDigit, positiveSign, negativeSign, decimalSeparator);
}
 
Example 17
Source File: Formatter.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private static char getZero(Locale l) {
    if ((l != null) && !l.equals(Locale.US)) {
        DecimalFormatSymbols dfs = DecimalFormatSymbols.getInstance(l);
        return dfs.getZeroDigit();
    } else {
        return '0';
    }
}
 
Example 18
Source File: Formatter.java    From j2objc with Apache License 2.0 5 votes vote down vote up
private char getZero(Locale l) {
    if ((l != null) &&  !l.equals(locale())) {
        DecimalFormatSymbols dfs = DecimalFormatSymbols.getInstance(l);
        return dfs.getZeroDigit();
    }
    return zero;
}
 
Example 19
Source File: Formatter.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
private char getZero(Locale l) {
    if ((l != null) &&  !l.equals(locale())) {
        DecimalFormatSymbols dfs = DecimalFormatSymbols.getInstance(l);
        return dfs.getZeroDigit();
    }
    return zero;
}
 
Example 20
Source File: LocaleEnhanceTest.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
private void checkDigit(Locale loc, Character expected) {
    DecimalFormatSymbols dfs = DecimalFormatSymbols.getInstance(loc);
    Character zero = dfs.getZeroDigit();
    assertEquals("Wrong digit zero char", expected, zero);
}