Home
last modified time | relevance | path

Searched refs:DecimalFormat (Results 1 – 25 of 109) sorted by relevance

12345

/external/icu/icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/
DBigNumberFormatTest.java14 import com.ibm.icu.text.DecimalFormat;
32 DecimalFormat fmt1 = new DecimalFormat("0.###E0", US); in TestExponent()
33 DecimalFormat fmt2 = new DecimalFormat("0.###E+0", US); in TestExponent()
47 DecimalFormat f = new DecimalFormat("#,##,###", US); in TestSecondaryGrouping()
57 f = (DecimalFormat) NumberFormat.getInstance(new Locale("hi", "IN")); in TestSecondaryGrouping()
63 private void expectPad(DecimalFormat fmt, String pat, int pos) { in expectPad()
67 private void expectPad(DecimalFormat fmt, String pat, in expectPad()
95 DecimalFormat fmt = new DecimalFormat("#", US); in TestPatterns()
97 expectPad(fmt, "*^#", DecimalFormat.PAD_BEFORE_PREFIX, 1, '^'); in TestPatterns()
98 expectPad(fmt, "$*^#", DecimalFormat.PAD_AFTER_PREFIX, 2, '^'); in TestPatterns()
[all …]
DNumberRegression.java42 import com.ibm.icu.text.DecimalFormat;
94 DecimalFormat df = new DecimalFormat(); in Test4088161()
117 DecimalFormat df = new DecimalFormat("#,##0.0", symbols); in Test4087245()
134 DecimalFormat df = new DecimalFormat(); in Test4087535()
152 DecimalFormat df = new DecimalFormat(); in Test4088503()
190 DecimalFormat format = new DecimalFormat("00"); in Test4059870()
230 logln("nf toPattern1: " + ((DecimalFormat)nf).toPattern()); in Test4086575()
231 logln("nf toLocPattern1: " + ((DecimalFormat)nf).toLocalizedPattern()); in Test4086575()
235 ((DecimalFormat)nf).applyLocalizedPattern("###,00;(###,00)"); in Test4086575()
236 logln("nf toPattern2: " + ((DecimalFormat)nf).toPattern()); in Test4086575()
[all …]
DNumberFormatTest.java32 import com.ibm.icu.text.DecimalFormat;
50 DecimalFormat format = in TestRoundingScientific10542()
51 new DecimalFormat("0.00E0"); in TestRoundingScientific10542()
149 …private void verifyRounding(DecimalFormat format, double[] values, String[][] expected, int[] roun… in verifyRounding()
178 DecimalFormat parser = (DecimalFormat) NumberFormat.getInstance(new ULocale("fa")); in TestParseNegativeWithFaLocale()
188 DecimalFormat parser = (DecimalFormat) NumberFormat.getInstance(new ULocale("en")); in TestParseNegativeWithAlternativeMinusSign()
207 DecimalFormat fmt = new DecimalFormat(pat[i], sym); in TestPatterns()
277 DecimalFormat fmt = new DecimalFormat(pat[p], sym); in TestExponential()
328 DecimalFormat fmt = new DecimalFormat(pat.toString(), sym); in TestQuotes()
337 fmt = new DecimalFormat(pat.toString(), sym); in TestQuotes()
[all …]
DScientificNumberFormatterTest.java10 import com.ibm.icu.text.DecimalFormat;
50 DecimalFormat decfmt = (DecimalFormat) NumberFormat.getScientificInstance(ULocale.ENGLISH); in TestPlusSignInExponentMarkup()
63 DecimalFormat decfmt = (DecimalFormat) NumberFormat.getScientificInstance(ULocale.ENGLISH); in TestPlusSignInExponentSuperscript()
74 DecimalFormat decfmt = (DecimalFormat) NumberFormat.getInstance(ULocale.ENGLISH); in TestFixedDecimalMarkup()
84 DecimalFormat decfmt = (DecimalFormat) NumberFormat.getInstance(ULocale.ENGLISH); in TestFixedDecimalSuperscript()
DIntlTestDecimalFormatAPI.java27 import com.ibm.icu.text.DecimalFormat;
59 DecimalFormat dec = new DecimalFormat(pat); in testJB1871()
70 dec = new DecimalFormat(pat); in testJB1871()
80 dec = new DecimalFormat(pat); in testJB1871()
106 DecimalFormat def = new DecimalFormat(); in TestAPI()
109 DecimalFormat pat = null; in TestAPI()
111 pat = new DecimalFormat(pattern); in TestAPI()
119 DecimalFormat cust1 = new DecimalFormat(pattern, symbols); in TestAPI()
275 DecimalFormat decfmt = new DecimalFormat(); in testJB6134()
294 DecimalFormat decfmt = new DecimalFormat(); in testJB4971()
[all …]
DNumberFormatSpecificationTest.java10 import com.ibm.icu.text.DecimalFormat;
125 DecimalFormat fmt = new DecimalFormat("¤¤ **#######0", sym); in TestPadding()
133 DecimalFormat fmt = new DecimalFormat("¤¤ **#######0;¤¤ (#)", sym); in TestPadding()
140 DecimalFormat fmt = new DecimalFormat("QU**00.#####E0", sym); in TestPadding()
149 DecimalFormat fmt = new DecimalFormat(pattern, sym); in formatFrWithPattern()
155 return new DecimalFormat(pattern, sym); in nfWithPattern()
DIntlTestDecimalFormatAPIC.java24 import com.ibm.icu.text.DecimalFormat;
48 DecimalFormat def = new DecimalFormat(); in TestAPI()
51 DecimalFormat pat = null; in TestAPI()
53 pat = new DecimalFormat(pattern); in TestAPI()
60 DecimalFormat cust1 = new DecimalFormat(pattern, symbols); in TestAPI()
245 DecimalFormat pat = new DecimalFormat(); in TestRounding()
295 DecimalFormat format = new DecimalFormat("###0.##\u2030"); in testFormatToCharacterIterator()
299 format = new DecimalFormat("00.0#E0"); in testFormatToCharacterIterator()
303 format = new DecimalFormat("0000.0#E0"); in testFormatToCharacterIterator()
/external/icu/icu4c/source/test/intltest/
Dnumfmtst.cpp242 DecimalFormat fmt(pat[i], sym, status); in TestPatterns()
377 DecimalFormat fmt(pat[p], sym, status); in TestExponential()
468 DecimalFormat* fmt = (DecimalFormat*)NumberFormat::createCurrencyInstance("en_US", status); in TestScientific2()
484 DecimalFormat fmt("##0.00E0",status); in TestScientificGrouping()
519 DecimalFormat fmt("#.#E0",status); in TestInt64()
611 DecimalFormat *fmt = new DecimalFormat(*pat, *sym, status); in TestQuotes()
624 fmt = new DecimalFormat(*pat, *sym, status); in TestQuotes()
653 DecimalFormat *fmt = new DecimalFormat(pat, *sym, status); in TestCurrencySign()
670 fmt = new DecimalFormat(pat, *sym, status); in TestCurrencySign()
858 DecimalFormat* format = new DecimalFormat("00", status); in TestParse()
[all …]
Dscientificnumberformattertest.cpp118 …LocalPointer<DecimalFormat> decfmt((DecimalFormat *) NumberFormat::createScientificInstance("en", … in TestPlusSignInExponentMarkup()
130 new DecimalFormat(*decfmt), "<sup>", "</sup>", status)); in TestPlusSignInExponentMarkup()
145 …LocalPointer<DecimalFormat> decfmt((DecimalFormat *) NumberFormat::createScientificInstance("en", … in TestPlusSignInExponentSuperscript()
157 new DecimalFormat(*decfmt), status)); in TestPlusSignInExponentSuperscript()
172 … LocalPointer<DecimalFormat> decfmt((DecimalFormat *) NumberFormat::createInstance("en", status)); in TestFixedDecimalMarkup()
178 new DecimalFormat(*decfmt), "<sup>", "</sup>", status)); in TestFixedDecimalMarkup()
194 … LocalPointer<DecimalFormat> decfmt((DecimalFormat *) NumberFormat::createInstance("en", status)); in TestFixedDecimalSuperscript()
200 new DecimalFormat(*decfmt), status)); in TestFixedDecimalSuperscript()
Dnumfmtst.h251 void expectPad(DecimalFormat& fmt, const UnicodeString& pat,
254 void expectPad(DecimalFormat& fmt, const char *pat, in expectPad()
259 void expectPad(DecimalFormat& fmt, const UnicodeString& pat,
262 void expectPad(DecimalFormat& fmt, const char *pat, in expectPad()
267 void expectPat(DecimalFormat& fmt, const UnicodeString& exp);
269 void expectPat(DecimalFormat& fmt, const char *exp) { in expectPat()
273 void expectPad(DecimalFormat& fmt, const UnicodeString& pat,
276 void expectPad(DecimalFormat& fmt, const char *pat, in expectPad()
295 void checkRounding(DecimalFormat* df, double base, int iterations, double increment);
297 double checkRound(DecimalFormat* df, double iValue, double lastParsed);
[all …]
Dnumrgts.cpp287 DecimalFormat *df = new DecimalFormat(status); in Test4088161()
323 DecimalFormat *df = new DecimalFormat("#,##0.0", *symbols, status); in Test4087245()
347 DecimalFormat *df = new DecimalFormat(status); in Test4087535()
372 DecimalFormat *df = new DecimalFormat(status); in Test4088503()
433 DecimalFormat *format = new DecimalFormat("00", status); in Test4059870()
513 DecimalFormat *nf = dynamic_cast<DecimalFormat *>(nf1); in Test4086575()
583 DecimalFormat *df = new DecimalFormat(status); in Test4068693()
639 DecimalFormat *df = new DecimalFormat(status); in Test4087251()
705 DecimalFormat *df = new DecimalFormat(status); in Test4090504()
734 DecimalFormat *df = new DecimalFormat(status); in Test4095713()
[all …]
Ddcfmapts.cpp104 DecimalFormat def(status); in testAPI()
112 DecimalFormat noGrouping("###0.##", status); in testAPI()
120 DecimalFormat pat(pattern, status); in testAPI()
134 DecimalFormat cust1(pattern, symbols, status); in testAPI()
140 DecimalFormat cust2(pattern, *symbols, status); in testAPI()
145 DecimalFormat copy(pat); in testAPI()
402 NumberFormat *test = new DecimalFormat(status); in testAPI()
407 if(test->getDynamicClassID() != DecimalFormat::getStaticClassID()) { in testAPI()
443 DecimalFormat *df = new DecimalFormat(status); in TestCurrencyPluralInfo()
471 DecimalFormat pat(status); in testRounding()
[all …]
Ddcfmtest.cpp325 DecimalFormat format(pattern, symbols, status); in execParseTest()
392 DecimalFormat fmtr(pattern, symbols, status); in execFormatTest()
399 fmtr.setRoundingMode(DecimalFormat::kRoundCeiling); in execFormatTest()
401 fmtr.setRoundingMode(DecimalFormat::kRoundFloor); in execFormatTest()
403 fmtr.setRoundingMode(DecimalFormat::kRoundDown); in execFormatTest()
405 fmtr.setRoundingMode(DecimalFormat::kRoundUp); in execFormatTest()
407 fmtr.setRoundingMode(DecimalFormat::kRoundHalfEven); in execFormatTest()
409 fmtr.setRoundingMode(DecimalFormat::kRoundHalfDown); in execFormatTest()
411 fmtr.setRoundingMode(DecimalFormat::kRoundHalfUp); in execFormatTest()
415 fmtr.setRoundingMode(DecimalFormat::kRoundUnnecessary); in execFormatTest()
[all …]
Dnumfmtspectest.cpp37 DecimalFormat *result = new DecimalFormat( in nfWithPattern()
188 DecimalFormat fmt( in TestPadding()
201 DecimalFormat fmt( in TestPadding()
215 DecimalFormat fmt( in TestPadding()
239 DecimalFormat fmt( in assertPatternFr()
/external/icu/icu4c/source/i18n/
Ddecimfmt.cpp246 UOBJECT_DEFINE_RTTI_IMPLEMENTATION(DecimalFormat)
272 const int32_t DecimalFormat::kDoubleIntegerDigits = 309;
273 const int32_t DecimalFormat::kDoubleFractionDigits = 340;
275 const int32_t DecimalFormat::kMaxScientificIntegerDigits = 8;
281 const char DecimalFormat::fgNumberPatterns[]="NumberPatterns"; // Deprecated - not used
317 DecimalFormat::DecimalFormat(UErrorCode& status) { in DecimalFormat() function in DecimalFormat
327 DecimalFormat::DecimalFormat(const UnicodeString& pattern, in DecimalFormat() function in DecimalFormat
339 DecimalFormat::DecimalFormat(const UnicodeString& pattern, in DecimalFormat() function in DecimalFormat
349 DecimalFormat::DecimalFormat( const UnicodeString& pattern, in DecimalFormat() function in DecimalFormat
364 DecimalFormat::DecimalFormat(const UnicodeString& pattern, in DecimalFormat() function in DecimalFormat
[all …]
Dunum.cpp81 retVal = new DecimalFormat(pat, syms, *parseErr, *status); in unum_open()
144 const DecimalFormat* df = dynamic_cast<const DecimalFormat*>(nf); in unum_clone()
478 const DecimalFormat* df = dynamic_cast<const DecimalFormat*>(nf); in unum_getAttribute()
499 DecimalFormat* df = dynamic_cast<DecimalFormat*>(nf); in unum_setAttribute()
511 const DecimalFormat* df = dynamic_cast<const DecimalFormat*>(nf); in unum_getDoubleAttribute()
525 DecimalFormat* df = dynamic_cast<DecimalFormat*>(nf); in unum_setDoubleAttribute()
549 const DecimalFormat* df = dynamic_cast<const DecimalFormat*>(nf); in unum_getTextAttribute()
612 DecimalFormat* df = dynamic_cast<DecimalFormat*>(nf); in unum_setTextAttribute()
672 const DecimalFormat* df = dynamic_cast<const DecimalFormat*>(nf); in unum_toPattern()
701 const DecimalFormat *dcf = dynamic_cast<const DecimalFormat *>(nf); in unum_getSymbol()
[all …]
Dscientificnumberformatter.cpp59 DecimalFormat *fmtToAdopt, UErrorCode &status) { in createSuperscriptInstance()
66 static_cast<DecimalFormat *>( in createSuperscriptInstance()
67 DecimalFormat::createScientificInstance(locale, status)), in createSuperscriptInstance()
73 DecimalFormat *fmtToAdopt, in createMarkupInstance()
89 static_cast<DecimalFormat *>( in createMarkupInstance()
90 DecimalFormat::createScientificInstance(locale, status)), in createMarkupInstance()
96 DecimalFormat *fmtToAdopt, in createInstance()
99 LocalPointer<DecimalFormat> fmt(fmtToAdopt); in createInstance()
241 DecimalFormat *fmtToAdopt, Style *styleToAdopt, UErrorCode &status) in ScientificNumberFormatter()
269 fDecimalFormat = static_cast<DecimalFormat *>( in ScientificNumberFormatter()
/external/icu/icu4j/main/classes/core/src/com/ibm/icu/text/
DCompactDecimalDataCache.java66 Map<String, DecimalFormat.Unit[]> units;
68 Data(long[] divisors, Map<String, DecimalFormat.Unit[]> units) { in Data()
238 new HashMap<String, DecimalFormat.Unit[]>()); in loadStyle()
353 saveUnit(new DecimalFormat.Unit(prefix, suffix), pluralVariant, idx, result.units); in populatePrefixSuffix()
443 int idx, Map<String, DecimalFormat.Unit[]> units) { in propagateOtherToMissing()
444 DecimalFormat.Unit otherVariantValue = units.get(OTHER)[idx]; in propagateOtherToMissing()
445 for (DecimalFormat.Unit[] byBase : units.values()) { in propagateOtherToMissing()
452 private static void copyFromPreviousIndex(int idx, Map<String, DecimalFormat.Unit[]> units) { in copyFromPreviousIndex()
453 for (DecimalFormat.Unit[] byBase : units.values()) { in copyFromPreviousIndex()
455 byBase[idx] = DecimalFormat.NULL_UNIT; in copyFromPreviousIndex()
[all …]
DScientificNumberFormatter.java39 private final DecimalFormat fmt;
67 DecimalFormat df) { in getSuperscriptInstance()
104 DecimalFormat df, in getMarkupInstance()
235 if (DecimalFormat.minusSigns.contains(aChar)) { in format()
242 } else if (DecimalFormat.plusSigns.contains(aChar)) { in format()
313 DecimalFormat decimalFormat, Style style) { in getInstance()
316 (DecimalFormat) decimalFormat.clone(), getPreExponent(dfs), style); in getInstance()
321 DecimalFormat decimalFormat = in getInstanceForLocale()
322 (DecimalFormat) DecimalFormat.getScientificInstance(locale); in getInstanceForLocale()
332 DecimalFormat decimalFormat, String preExponent, Style style) { in ScientificNumberFormatter()
DCompactDecimalFormat.java53 public class CompactDecimalFormat extends DecimalFormat {
60 private final Map<String, DecimalFormat.Unit[]> units;
118 DecimalFormat format = (DecimalFormat) NumberFormat.getInstance(locale); in CompactDecimalFormat()
215 Map<String, DecimalFormat.Unit[]> lhs, Map<String, DecimalFormat.Unit[]> rhs) { in mapsAreEqual()
220 for (Map.Entry<String, DecimalFormat.Unit[]> entry : lhs.entrySet()) { in mapsAreEqual()
221 DecimalFormat.Unit[] value = rhs.get(entry.getKey()); in mapsAreEqual()
355 …private Map<String, DecimalFormat.Unit[]> otherPluralVariant(Map<String, String[][]> pluralCategor… in otherPluralVariant()
383 Map<String, DecimalFormat.Unit[]> result = new HashMap<String, DecimalFormat.Unit[]>(); in otherPluralVariant()
396 DecimalFormat.Unit[] units = new DecimalFormat.Unit[power10ToAffix.length]; in otherPluralVariant()
DDecimalFormatSymbols.java874 digits[0] = DecimalFormat.PATTERN_ZERO_DIGIT; in initialize()
875 digits[1] = DecimalFormat.PATTERN_ONE_DIGIT; in initialize()
876 digits[2] = DecimalFormat.PATTERN_TWO_DIGIT; in initialize()
877 digits[3] = DecimalFormat.PATTERN_THREE_DIGIT; in initialize()
878 digits[4] = DecimalFormat.PATTERN_FOUR_DIGIT; in initialize()
879 digits[5] = DecimalFormat.PATTERN_FIVE_DIGIT; in initialize()
880 digits[6] = DecimalFormat.PATTERN_SIX_DIGIT; in initialize()
881 digits[7] = DecimalFormat.PATTERN_SEVEN_DIGIT; in initialize()
882 digits[8] = DecimalFormat.PATTERN_EIGHT_DIGIT; in initialize()
883 digits[9] = DecimalFormat.PATTERN_NINE_DIGIT; in initialize()
[all …]
/external/icu/icu4j/main/tests/framework/src/com/ibm/icu/dev/util/
DTimer.java9 import com.ibm.icu.text.DecimalFormat;
57 public DecimalFormat getNumberFormat() { in getNumberFormat()
61 public DecimalFormat getPercentFormat() { in getPercentFormat()
79 private DecimalFormat nf = (DecimalFormat) NumberFormat.getNumberInstance(ULocale.ENGLISH);
80 private DecimalFormat pf = (DecimalFormat) NumberFormat.getPercentInstance(ULocale.ENGLISH);
/external/icu/icu4c/source/i18n/unicode/
Dscientificnumberformatter.h28 class DecimalFormat; variable
64 DecimalFormat *fmtToAdopt, UErrorCode &status);
92 DecimalFormat *fmtToAdopt,
195 DecimalFormat *fmtToAdopt,
206 DecimalFormat *fmtToAdopt,
211 DecimalFormat *fDecimalFormat;
Ddecimfmt.h663 class U_I18N_API DecimalFormat: public NumberFormat {
711 DecimalFormat(UErrorCode& status);
727 DecimalFormat(const UnicodeString& pattern,
748 DecimalFormat( const UnicodeString& pattern,
765 DecimalFormat( const UnicodeString& pattern,
790 virtual DecimalFormat& setAttribute( UNumberFormatAttribute attr,
854 DecimalFormat( const UnicodeString& pattern,
875 DecimalFormat( const UnicodeString& pattern,
885 DecimalFormat(const DecimalFormat& source);
893 DecimalFormat& operator=(const DecimalFormat& rhs);
[all …]
/external/emma/core/java12/com/vladium/emma/report/
DIItemAttribute.java11 import java.text.DecimalFormat;
204 m_format = (DecimalFormat) NumberFormat.getPercentInstance (); // TODO: locale in FractionAttribute()
205 m_fieldPosition = new FieldPosition (DecimalFormat.INTEGER_FIELD); in FractionAttribute()
212 m_nFormat = (DecimalFormat) NumberFormat.getInstance (); // TODO: locale in FractionAttribute()
223 private final DecimalFormat m_format, m_nFormat;

12345