Lines Matching refs:ec
1243 UErrorCode ec = U_ZERO_ERROR;
1245 NumberFormat::createCurrencyInstance(Locale::getUS(), ec);
1247 if (U_FAILURE(ec)) {
1248 dataerrln("FAIL: getCurrencyInstance(US) - %s", u_errorName(ec));
1270 fmt = NumberFormat::createCurrencyInstance(Locale::getFrance(), ec);
1272 if (U_FAILURE(ec)) {
1658 UErrorCode ec = U_ZERO_ERROR;
1659 DecimalFormatSymbols US(Locale::getUS(), ec);
1660 DecimalFormat fmt("a b#0c ", US, ec);
1661 if (U_FAILURE(ec)) {
1662 errcheckln(ec, "FAIL: Constructor - %s", u_errorName(ec));
1675 // UErrorCode ec = U_ZERO_ERROR;
1677 // NumberFormat* fmt = NumberFormat::createCurrencyInstance(loc, ec);
1678 // if (U_SUCCESS(ec)) {
2154 UErrorCode ec = U_ZERO_ERROR;
2155 NumberFormat* nf = NumberFormat::createCurrencyInstance(locs[i], ec);
2156 if (U_FAILURE(ec)) {
2157 errln("FAIL: Can't create NumberFormat(%s) - %s", locs[i].getName(), u_errorName(ec));
2261 UErrorCode ec = U_ZERO_ERROR;
2275 &isChoiceFormat, &len, &ec)),
2281 ec)),
2287 &isChoiceFormat, &len, &ec)),
2293 &isChoiceFormat, &len, &ec)),
2299 &isChoiceFormat, &len, &ec)),
2305 &isChoiceFormat, &len, &ec)),
2311 &isChoiceFormat, &len, &ec)),
2313 assertSuccess("ucurr_getName", ec);
2315 ec = U_ZERO_ERROR;
2319 &len, &ec);
2321 U_USING_FALLBACK_WARNING == ec, TRUE, possibleDataError);
2324 &len, &ec);
2326 U_USING_FALLBACK_WARNING == ec, TRUE, possibleDataError);
2329 &len, &ec);
2331 U_USING_DEFAULT_WARNING == ec || U_USING_FALLBACK_WARNING == ec, TRUE);
2334 &len, &ec);
2336 U_USING_DEFAULT_WARNING == ec, TRUE);
2340 &len, &ec);
2342 U_USING_DEFAULT_WARNING == ec, TRUE);
2348 UErrorCode ec = U_ZERO_ERROR;
2352 CurrencyUnit cu(USD, ec);
2353 assertSuccess("CurrencyUnit", ec);
2367 CurrencyUnit bad(BAD, ec);
2368 assertSuccess("CurrencyUnit", ec);
2372 CurrencyUnit bad2(BAD2, ec);
2373 assertSuccess("CurrencyUnit", ec);
2388 UErrorCode ec = U_ZERO_ERROR;
2390 CurrencyAmount ca(9, USD, ec);
2391 assertSuccess("CurrencyAmount", ec);
2463 UErrorCode ec = U_ZERO_ERROR;
2464 DecimalFormatSymbols *sym = new DecimalFormatSymbols(Locale::getUS(), ec);
2465 if (U_FAILURE(ec)) {
2466 errcheckln(ec, "Fail: DecimalFormatSymbols constructor - %s", u_errorName(ec));
2472 DecimalFormat fmt(pat, sym, ec);
2473 if (U_FAILURE(ec)) {
2486 sym = new DecimalFormatSymbols(Locale::getUS(), ec);
2487 if (U_FAILURE(ec)) {
2503 sym = new DecimalFormatSymbols(Locale::getUS(), ec);
2504 if (U_FAILURE(ec)) {
2509 DecimalFormat fmt2(pat, sym, ec);
2510 if (U_FAILURE(ec)) {
2515 DecimalFormatSymbols sym2(Locale::getUS(), ec);
2516 if (U_FAILURE(ec)) {
2533 UErrorCode ec = U_ZERO_ERROR;
2535 DecimalFormat fmt(ctou("###.###\\u2030"), ec);
2536 if (!assertSuccess("DecimalFormat ct", ec)) return;
2540 DecimalFormatSymbols sym(Locale::getUS(), ec);
2542 DecimalFormat fmt2("", sym, ec);
2543 fmt2.applyLocalizedPattern("###.###m", ec);
2544 if (!assertSuccess("setup", ec)) return;
2567 UErrorCode ec = U_ZERO_ERROR;
2568 DecimalFormat fmt(pat, ec); // locale doesn't matter here
2569 if (U_SUCCESS(ec) == valid) {
2571 pat, u_errorName(ec));
2573 errcheckln(ec, "FAIL: pattern \"%s\" should have %s; got %s",
2575 u_errorName(ec));
2618 UErrorCode& ec) {
2624 fmt.parse(num, n, ec);
2625 result.adoptObject(new CurrencyAmount(n, cur.getTerminatedBuffer(), ec));
2629 UErrorCode ec = U_ZERO_ERROR;
2630 TextFile reader("NumberFormatTestCases.txt", "UTF8", ec);
2631 if (U_FAILURE(ec)) {
2644 ec = U_ZERO_ERROR;
2645 if (!tokens.next(tok, ec)) {
2653 if (!tokens.next(tok, ec)) goto error;
2656 new DecimalFormatSymbols(Locale::getUS(), ec), ec);
2657 if (U_FAILURE(ec)) {
2664 if (!tokens.next(tok, ec)) goto error;
2665 loc = Locale::createFromName(CharString().appendInvariantChars(tok, ec).data());
2671 if (!tokens.next(tok, ec)) goto error;
2675 fmt = new DecimalFormat(pat, new DecimalFormatSymbols(loc, ec), ec);
2676 if (U_FAILURE(ec)) {
2677 errln("FAIL: " + where + "Pattern \"" + pat + "\": " + u_errorName(ec));
2678 ec = U_ZERO_ERROR;
2679 if (!tokens.next(tok, ec)) goto error;
2680 if (!tokens.next(tok, ec)) goto error;
2682 if (!tokens.next(tok, ec)) goto error;
2692 if (!tokens.next(num, ec)) goto error;
2693 if (!tokens.next(str, ec)) goto error;
2694 ref->parse(num, n, ec);
2695 assertSuccess("parse", ec);
2697 str, fmt->format(n, out.remove(), ec));
2698 assertSuccess("format", ec);
2700 if (!tokens.next(num, ec)) goto error;
2701 ref->parse(num, n, ec);
2702 assertSuccess("parse", ec);
2706 fmt->parse(str, m, ec);
2707 assertSuccess("parse", ec);
2715 if (!tokens.next(str, ec)) goto error;
2716 if (!tokens.next(expstr, ec)) goto error;
2718 ref->parse(expstr, exp, ec);
2719 assertSuccess("parse", ec);
2720 fmt->parse(str, n, ec);
2721 assertSuccess("parse", ec);
2727 if (!tokens.next(tok, ec)) goto error;
2733 CharString().appendInvariantChars(mloc, ec).data()), ec);
2734 if (U_FAILURE(ec)) {
2735 errln("FAIL: " + where + "Loc \"" + mloc + "\": " + u_errorName(ec));
2736 ec = U_ZERO_ERROR;
2737 if (!tokens.next(tok, ec)) goto error;
2738 if (!tokens.next(tok, ec)) goto error;
2739 if (!tokens.next(tok, ec)) goto error;
2744 if (!tokens.next(tok, ec)) goto error;
2745 if (!tokens.next(tok, ec)) goto error;
2746 if (!tokens.next(tok, ec)) goto error;
2750 if (!tokens.next(currAmt, ec)) goto error;
2751 if (!tokens.next(str, ec)) goto error;
2752 parseCurrencyAmount(currAmt, *ref, (UChar)0x2F/*'/'*/, n, ec);
2753 if (assertSuccess("parseCurrencyAmount", ec)) {
2755 str, mfmt->format(n, out.remove(), ec));
2756 assertSuccess("format", ec);
2758 if (!tokens.next(currAmt, ec)) goto error;
2759 parseCurrencyAmount(currAmt, *ref, (UChar)0x2F/*'/'*/, n, ec);
2760 if (assertSuccess("parseCurrencyAmount", ec)) {
2763 mfmt->parseObject(str, m, ec);
2764 if (assertSuccess("parseCurrency", ec)) {
2780 if (!tokens.next(testpat, ec)) goto error;
2781 if (!tokens.next(exppat, ec)) goto error;
2828 if (U_SUCCESS(ec)) {
2831 errcheckln(ec, "FAIL: " + where + "Unexpected " + u_errorName(ec));
3020 UErrorCode ec = U_ZERO_ERROR;
3026 ucurr_forLocale(locale.getName(), curr, 4, &ec);
3027 assertSuccess("ucurr_forLocale", ec);
3028 fmt.setCurrency(curr, ec);
3029 assertSuccess("DecimalFormat::setCurrency", ec);
3039 NumberFormat::createInstance(Locale::getUS(), ec);
3041 if (U_FAILURE(ec)) {
3587 UErrorCode ec;
3591 ec = U_ZERO_ERROR;
3594 NumberFormat *origFmt = NumberFormat::createInstance(loc,ec);
3595 if (U_FAILURE(ec)) {
3596 dataerrln("FAIL: getInstance(%s) - %s", item->localeName, u_errorName(ec));
3614 ec = U_ZERO_ERROR;
3616 NumberFormat* fmt4= NumberFormat::createInstance(loc4, ec);
3617 if ( ec != U_UNSUPPORTED_ERROR ) {
3622 ec = U_ZERO_ERROR;
3623 NumberingSystem *ns = NumberingSystem::createInstance(ec);
3624 if (U_FAILURE(ec)) {
3625 dataerrln("FAIL: NumberingSystem::createInstance(ec); - %s", u_errorName(ec));
3759 errln("FAIL: measure format parsing: '%s' ec: %s", formats[i], u_errorName(status));
4370 "EC$1.00",