/** * Get the "percent" attribute. * percent specifies the character used as a percent sign; the default * value is the percent character (%). * * @return Character to use as percent */ public char getPercent() { return m_dfs.getPercent(); }
/** * Get the "percent" attribute. * percent specifies the character used as a percent sign; the default * value is the percent character (%). * * @return Character to use as percent */ public char getPercent() { return m_dfs.getPercent(); }
public NativeDecimalFormat(String pattern, DecimalFormatSymbols dfs) { try { this.address = open(pattern, dfs.getCurrencySymbol(), dfs.getDecimalSeparator(), dfs.getDigit(), dfs.getExponentSeparator(), dfs.getGroupingSeparator(), dfs.getInfinity(), dfs.getInternationalCurrencySymbol(), dfs.getMinusSign(), dfs.getMonetaryDecimalSeparator(), dfs.getNaN(), dfs.getPatternSeparator(), dfs.getPercent(), dfs.getPerMill(), dfs.getZeroDigit()); this.lastPattern = pattern; } catch (NullPointerException npe) { throw npe; } catch (RuntimeException re) { throw new IllegalArgumentException("syntax error: " + re.getMessage() + ": " + pattern); } }
/** * Copies the DecimalFormatSymbols settings into our native peer in bulk. */ public void setDecimalFormatSymbols(final DecimalFormatSymbols dfs) { setDecimalFormatSymbols(this.address, dfs.getCurrencySymbol(), dfs.getDecimalSeparator(), dfs.getDigit(), dfs.getExponentSeparator(), dfs.getGroupingSeparator(), dfs.getInfinity(), dfs.getInternationalCurrencySymbol(), dfs.getMinusSign(), dfs.getMonetaryDecimalSeparator(), dfs.getNaN(), dfs.getPatternSeparator(), dfs.getPercent(), dfs.getPerMill(), dfs.getZeroDigit()); }
private void writeObject(ObjectOutputStream stream) throws IOException { ObjectOutputStream.PutField fields = stream.putFields(); fields.put("currencySymbol", currencySymbol); fields.put("decimalSeparator", getDecimalSeparator()); fields.put("digit", getDigit()); fields.put("exponential", exponentSeparator.charAt(0)); fields.put("exponentialSeparator", exponentSeparator); fields.put("groupingSeparator", getGroupingSeparator()); fields.put("infinity", infinity); fields.put("intlCurrencySymbol", intlCurrencySymbol); fields.put("minusSign", getMinusSign()); fields.put("monetarySeparator", getMonetaryDecimalSeparator()); fields.put("NaN", NaN); fields.put("patternSeparator", getPatternSeparator()); fields.put("percent", getPercent()); fields.put("perMill", getPerMill()); fields.put("serialVersionOnStream", 3); fields.put("zeroDigit", getZeroDigit()); fields.put("locale", locale); stream.writeFields(); }
dformat.setNegativePrefix("("); dformat.setNegativeSuffix( "" + dformat.getDecimalFormatSymbols().getPercent() + ")"); } else { DecimalFormat dformat = (DecimalFormat)format; "" + dformat.getDecimalFormatSymbols().getMinusSign()); dformat.setNegativeSuffix( "" + dformat.getDecimalFormatSymbols().getPercent());
/** * Return the character used for percent sign. Different for Arabic, etc. * @return the percent character * @stable ICU 2.0 */ public char getPercent() { return dfs.getPercent(); }
/** * Return the character used for percent sign. Different for Arabic, etc. * @return the percent character * @stable ICU 2.0 */ public char getPercent() { return dfs.getPercent(); }
/** * Get the "percent" attribute. * percent specifies the character used as a percent sign; the default * value is the percent character (%). * * @return Character to use as percent */ public char getPercent() { return m_dfs.getPercent(); }
/** * Get the "percent" attribute. * percent specifies the character used as a percent sign; the default * value is the percent character (%). * * @return Character to use as percent */ public char getPercent() { return m_dfs.getPercent(); }
/** * Get the "percent" attribute. * percent specifies the character used as a percent sign; the default * value is the percent character (%). * * @return Character to use as percent */ public char getPercent() { return m_dfs.getPercent(); }
/** * @return the character used for percent sign. */ public char getPercent() { return formatSymbols.getPercent(); } /**
@Override public String getSuffix(DecimalFormatSymbols symbols) { return " " + symbols.getPercent(); } };
/** * Get the "percent" attribute. * percent specifies the character used as a percent sign; the default * value is the percent character (%). * * @return Character to use as percent */ public char getPercent() { return m_dfs.getPercent(); }
/** * Get the "percent" attribute. * percent specifies the character used as a percent sign; the default * value is the percent character (%). * * @return Character to use as percent */ public char getPercent() { return m_dfs.getPercent(); }
protected final double parseUncertainty(String str, double value) { char percent = symbols.getPercent(); str = StringUtils.substringBetween(str, "(", ")"); if (StringUtils.contains(str, percent)) { int idx = str.indexOf(percent); str = str.substring(0, idx); return Double.valueOf(str) / 100 * value; } else { return Double.valueOf(str); } }
/** Output number relevant texts. */ private static final String outNumberJavaScript(Locale locale) { final DecimalFormatSymbols symbols = new DecimalFormatSymbols(locale); final StringBuffer sb = new StringBuffer(128); appendAssignJavaScript(sb, "zk.GROUPING", symbols.getGroupingSeparator()); appendAssignJavaScript(sb, "zk.DECIMAL", symbols.getDecimalSeparator()); appendAssignJavaScript(sb, "zk.PERCENT", symbols.getPercent()); appendAssignJavaScript(sb, "zk.MINUS", symbols.getMinusSign()); appendAssignJavaScript(sb, "zk.PER_MILL", symbols.getPerMill()); return sb.toString(); }
private String getSymbol(DecimalFormat formatter) { if (isPercent()) { return String.valueOf(formatter.getDecimalFormatSymbols().getPercent()); } else if (isCurrency()) { return formatter.getDecimalFormatSymbols().getCurrencySymbol(); } else { return null; } }
/** * Copies the DecimalFormatSymbols settings into our native peer in bulk. */ public void setDecimalFormatSymbols(final DecimalFormatSymbols dfs) { setDecimalFormatSymbols(this.address, dfs.getCurrencySymbol(), dfs.getDecimalSeparator(), dfs.getDigit(), dfs.getExponentSeparator(), dfs.getGroupingSeparator(), dfs.getInfinity(), dfs.getInternationalCurrencySymbol(), dfs.getMinusSign(), dfs.getMonetaryDecimalSeparator(), dfs.getNaN(), dfs.getPatternSeparator(), dfs.getPercent(), dfs.getPerMill(), dfs.getZeroDigit()); }
/** * Copies the DecimalFormatSymbols settings into our native peer in bulk. */ public void setDecimalFormatSymbols(final DecimalFormatSymbols dfs) { setDecimalFormatSymbols(this.address, dfs.getCurrencySymbol(), dfs.getDecimalSeparator(), dfs.getDigit(), dfs.getExponentSeparator(), dfs.getGroupingSeparator(), dfs.getInfinity(), dfs.getInternationalCurrencySymbol(), dfs.getMinusSign(), dfs.getMonetaryDecimalSeparator(), dfs.getNaN(), dfs.getPatternSeparator(), dfs.getPercent(), dfs.getPerMill(), dfs.getZeroDigit()); }