@qrvey/utils 1.16.0-3789 → 1.16.0-3791
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -65,13 +65,13 @@ function formatLocaleDate(value, outputFormat, config) {
|
|
|
65
65
|
}
|
|
66
66
|
const NUMBER_FORMAT_CACHE = [];
|
|
67
67
|
function formatLocaleNumber(value, outputFormat, config) {
|
|
68
|
-
var _a, _b;
|
|
68
|
+
var _a, _b, _c;
|
|
69
69
|
const { lang = definition_1.LANG_DEFAULT, options } = config;
|
|
70
70
|
let langOpts = options || getLocaleOptions(outputFormat);
|
|
71
71
|
const valueToFormat = (outputFormat === null || outputFormat === void 0 ? void 0 : outputFormat.format) === "Percentage" /* LOCALE_FORMATS.PERCENTAGE */ ? value / 100 : value;
|
|
72
72
|
try {
|
|
73
|
-
if (((_a = outputFormat === null || outputFormat === void 0 ? void 0 : outputFormat.currency) === null || _a === void 0 ? void 0 : _a["key"]) === 'default') {
|
|
74
|
-
langOpts = Object.assign(Object.assign({}, langOpts), { currency: (
|
|
73
|
+
if ((outputFormat === null || outputFormat === void 0 ? void 0 : outputFormat.format) == 'Currency' && (((_a = outputFormat === null || outputFormat === void 0 ? void 0 : outputFormat.currency) === null || _a === void 0 ? void 0 : _a["key"]) === 'default' || !((_b = outputFormat === null || outputFormat === void 0 ? void 0 : outputFormat.currency) === null || _b === void 0 ? void 0 : _b["text"]))) {
|
|
74
|
+
langOpts = Object.assign(Object.assign({}, langOpts), { currency: (_c = (0, locale_currency_1.getCurrency)(lang)) !== null && _c !== void 0 ? _c : definition_1.CURRENCY_DEFAULT.label });
|
|
75
75
|
}
|
|
76
76
|
const key = (outputFormat === null || outputFormat === void 0 ? void 0 : outputFormat.format) +
|
|
77
77
|
lang +
|
|
@@ -59,13 +59,13 @@ function formatLocaleDate(value, outputFormat, config) {
|
|
|
59
59
|
}
|
|
60
60
|
const NUMBER_FORMAT_CACHE = [];
|
|
61
61
|
function formatLocaleNumber(value, outputFormat, config) {
|
|
62
|
-
var _a, _b;
|
|
62
|
+
var _a, _b, _c;
|
|
63
63
|
const { lang = LANG_DEFAULT, options } = config;
|
|
64
64
|
let langOpts = options || getLocaleOptions(outputFormat);
|
|
65
65
|
const valueToFormat = (outputFormat === null || outputFormat === void 0 ? void 0 : outputFormat.format) === "Percentage" /* LOCALE_FORMATS.PERCENTAGE */ ? value / 100 : value;
|
|
66
66
|
try {
|
|
67
|
-
if (((_a = outputFormat === null || outputFormat === void 0 ? void 0 : outputFormat.currency) === null || _a === void 0 ? void 0 : _a["key"]) === 'default') {
|
|
68
|
-
langOpts = Object.assign(Object.assign({}, langOpts), { currency: (
|
|
67
|
+
if ((outputFormat === null || outputFormat === void 0 ? void 0 : outputFormat.format) == 'Currency' && (((_a = outputFormat === null || outputFormat === void 0 ? void 0 : outputFormat.currency) === null || _a === void 0 ? void 0 : _a["key"]) === 'default' || !((_b = outputFormat === null || outputFormat === void 0 ? void 0 : outputFormat.currency) === null || _b === void 0 ? void 0 : _b["text"]))) {
|
|
68
|
+
langOpts = Object.assign(Object.assign({}, langOpts), { currency: (_c = getCurrency(lang)) !== null && _c !== void 0 ? _c : CURRENCY_DEFAULT.label });
|
|
69
69
|
}
|
|
70
70
|
const key = (outputFormat === null || outputFormat === void 0 ? void 0 : outputFormat.format) +
|
|
71
71
|
lang +
|