當前位置: 首頁>>代碼示例>>Java>>正文


Java DecimalFormatSymbols.getZeroDigit方法代碼示例

本文整理匯總了Java中java.text.DecimalFormatSymbols.getZeroDigit方法的典型用法代碼示例。如果您正苦於以下問題:Java DecimalFormatSymbols.getZeroDigit方法的具體用法?Java DecimalFormatSymbols.getZeroDigit怎麽用?Java DecimalFormatSymbols.getZeroDigit使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在java.text.DecimalFormatSymbols的用法示例。


在下文中一共展示了DecimalFormatSymbols.getZeroDigit方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: LocalizeWriter

import java.text.DecimalFormatSymbols; //導入方法依賴的package包/類
public LocalizeWriter(Writer out, Locale locale, boolean localizeDigits, boolean isUpperCase)
{
    super(out);
    this.locale = locale;
    this.localizeDigits = localizeDigits;
    this.isUpperCase = isUpperCase;
    if (locale != null)
    {
        DecimalFormatSymbols decimalFormatSymbols = new DecimalFormatSymbols(locale);
        this.zero = decimalFormatSymbols.getZeroDigit();
        this.decimalSeparator = decimalFormatSymbols.getDecimalSeparator();
    }
    else
    {
        this.zero = '0';
        this.decimalSeparator = '.';
    }
}
 
開發者ID:mtommila,項目名稱:apfloat,代碼行數:19,代碼來源:FormattingHelper.java

示例2: withLocale

import java.text.DecimalFormatSymbols; //導入方法依賴的package包/類
/**
 * Configure this instance with values from a {@link Locale}.
 */
public MonetaryFormat withLocale(Locale locale) {
    DecimalFormatSymbols dfs = new DecimalFormatSymbols(locale);
    char negativeSign = dfs.getMinusSign();
    char zeroDigit = dfs.getZeroDigit();
    char decimalMark = dfs.getMonetaryDecimalSeparator();
    return new MonetaryFormat(negativeSign, positiveSign, zeroDigit, decimalMark, minDecimals, decimalGroups,
            shift, roundingMode, codes, codeSeparator, codePrefixed);
}
 
開發者ID:creativechain,項目名稱:creacoinj,代碼行數:12,代碼來源:MonetaryFormat.java

示例3: create

import java.text.DecimalFormatSymbols; //導入方法依賴的package包/類
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);
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:12,代碼來源:DecimalStyle.java

示例4: getZero

import java.text.DecimalFormatSymbols; //導入方法依賴的package包/類
private static char getZero(Locale l) {
    if ((l != null) && !l.equals(Locale.US)) {
        DecimalFormatSymbols dfs = DecimalFormatSymbols.getInstance(l);
        return dfs.getZeroDigit();
    } else {
        return '0';
    }
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:9,代碼來源:Formatter.java

示例5: checkDigit

import java.text.DecimalFormatSymbols; //導入方法依賴的package包/類
private void checkDigit(Locale loc, Character expected) {
    DecimalFormatSymbols dfs = DecimalFormatSymbols.getInstance(loc);
    Character zero = dfs.getZeroDigit();
    assertEquals("Wrong digit zero char", expected, zero);
}
 
開發者ID:lambdalab-mirror,項目名稱:jdk8u-jdk,代碼行數:6,代碼來源:LocaleEnhanceTest.java


注:本文中的java.text.DecimalFormatSymbols.getZeroDigit方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。