本文整理匯總了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 = '.';
}
}
示例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);
}
示例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);
}
示例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';
}
}
示例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);
}