- NumberFormat* f5 = NumberFormat::createCurrencyInstance(SRC_LOC, status);
- UNumberFormat* uf5 = unum_open(UNUM_CURRENCY, NULL, 0, SRC_LOC.getName(),NULL, &status);
-
- float n = 1234.567f;
- UnicodeString res0, res1, res2, res3, res4, res5;
- UChar ures3[50];
- UChar ures4[50];
- UChar ures5[50];
-
- f0->format(n, res0);
- f1->format(n, res1);
- f2->format(n, res2);
- f3->format(n, res3);
- f4->format(n, res4);
- f5->format(n, res5);
-
- unum_formatDouble(uf3, n, ures3, 50, NULL, &status);
- unum_formatDouble(uf4, n, ures4, 50, NULL, &status);
- unum_formatDouble(uf5, n, ures5, 50, NULL, &status);
-
- logln((UnicodeString)"f0 swap int: " + res0);
- logln((UnicodeString)"f1 src int: " + res1);
- logln((UnicodeString)"f2 src cur: " + res2);
- logln((UnicodeString)"f3 reg cur: " + res3);
- logln((UnicodeString)"f4 reg int: " + res4);
- logln((UnicodeString)"f5 unreg cur: " + res5);
- log("uf3 reg cur: ");
- logln(ures3);
- log("uf4 reg int: ");
- logln(ures4);
- log("uf5 ureg cur: ");
- logln(ures5);
-
- if (f3 == f3a) {
- errln("did not get new instance from service");
+ LocalPointer<NumberFormat> f5(NumberFormat::createCurrencyInstance(SRC_LOC, status));
+ LocalUNumberFormatPointer uf5(unum_open(UNUM_CURRENCY, NULL, 0, SRC_LOC.getName(), NULL, &status));
+
+ if (U_FAILURE(status)) {
+ dataerrln("Error creating instnaces.");
+ return;