当前位置: 首页>>代码示例>>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;未经允许,请勿转载。