@qrvey/utils 1.16.1-20 → 1.16.1-22
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.
|
@@ -31,7 +31,7 @@ export declare const enum LOCALE_STYLES {
|
|
|
31
31
|
SCIENTIFIC = "scientific",
|
|
32
32
|
COMPACT = "compact"
|
|
33
33
|
}
|
|
34
|
-
export declare const LANG_DEFAULT = "en
|
|
34
|
+
export declare const LANG_DEFAULT = "en";
|
|
35
35
|
export declare const CURRENCY_DEFAULT: {
|
|
36
36
|
text: string;
|
|
37
37
|
label: string;
|
|
@@ -114,7 +114,7 @@ exports.STANDARD_NUMERIC_FORMATS = [
|
|
|
114
114
|
"Abbreviated",
|
|
115
115
|
"Duration",
|
|
116
116
|
];
|
|
117
|
-
exports.LANG_DEFAULT = "en
|
|
117
|
+
exports.LANG_DEFAULT = "en";
|
|
118
118
|
exports.CURRENCY_DEFAULT = { text: "$ (USD)", label: "USD" };
|
|
119
119
|
exports.DATETIME_OPTIONS = {
|
|
120
120
|
year: "numeric",
|
|
@@ -72,7 +72,7 @@ function formatLocaleNumber(value, outputFormat, config) {
|
|
|
72
72
|
try {
|
|
73
73
|
const fixedCurrencyCode = (0, helpers_1.fixCurrencyFormatOverride)(config.currencyFormatOverride);
|
|
74
74
|
if ((0, isDefaultCurrent_1.isDefaultCurrent)(outputFormat.currency) &&
|
|
75
|
-
|
|
75
|
+
(0, helpers_1.getCurrencySymbolByCode)(fixedCurrencyCode)) {
|
|
76
76
|
langOpts = Object.assign(Object.assign({}, langOpts), { currency: fixedCurrencyCode });
|
|
77
77
|
}
|
|
78
78
|
const key = (outputFormat === null || outputFormat === void 0 ? void 0 : outputFormat.format) +
|
|
@@ -31,7 +31,7 @@ export declare const enum LOCALE_STYLES {
|
|
|
31
31
|
SCIENTIFIC = "scientific",
|
|
32
32
|
COMPACT = "compact"
|
|
33
33
|
}
|
|
34
|
-
export declare const LANG_DEFAULT = "en
|
|
34
|
+
export declare const LANG_DEFAULT = "en";
|
|
35
35
|
export declare const CURRENCY_DEFAULT: {
|
|
36
36
|
text: string;
|
|
37
37
|
label: string;
|
|
@@ -107,7 +107,7 @@ export const STANDARD_NUMERIC_FORMATS = [
|
|
|
107
107
|
"Abbreviated",
|
|
108
108
|
"Duration",
|
|
109
109
|
];
|
|
110
|
-
export const LANG_DEFAULT = "en
|
|
110
|
+
export const LANG_DEFAULT = "en";
|
|
111
111
|
export const CURRENCY_DEFAULT = { text: "$ (USD)", label: "USD" };
|
|
112
112
|
export const DATETIME_OPTIONS = {
|
|
113
113
|
year: "numeric",
|
|
@@ -2,7 +2,7 @@ import { ISOToNumericOffset } from "../dates";
|
|
|
2
2
|
import { isEmpty } from "../general/mix/isEmpty";
|
|
3
3
|
import { currencyISO, LANG_DEFAULT, CURRENCY_DEFAULT, DATETIME_OPTIONS, } from "./definition";
|
|
4
4
|
import { DurationFormatter } from "./duration/durationFormatter";
|
|
5
|
-
import { fixCurrencyFormatOverride } from "./helpers";
|
|
5
|
+
import { fixCurrencyFormatOverride, getCurrencySymbolByCode } from "./helpers";
|
|
6
6
|
import { isDateTimeFormat } from "./helpers/isDateTimeFormat";
|
|
7
7
|
import { isDefaultCurrent } from "./helpers/isDefaultCurrent";
|
|
8
8
|
export const getLang = (locale) => {
|
|
@@ -66,7 +66,7 @@ function formatLocaleNumber(value, outputFormat, config) {
|
|
|
66
66
|
try {
|
|
67
67
|
const fixedCurrencyCode = fixCurrencyFormatOverride(config.currencyFormatOverride);
|
|
68
68
|
if (isDefaultCurrent(outputFormat.currency) &&
|
|
69
|
-
|
|
69
|
+
getCurrencySymbolByCode(fixedCurrencyCode)) {
|
|
70
70
|
langOpts = Object.assign(Object.assign({}, langOpts), { currency: fixedCurrencyCode });
|
|
71
71
|
}
|
|
72
72
|
const key = (outputFormat === null || outputFormat === void 0 ? void 0 : outputFormat.format) +
|