@trafilea/afrodita-components 6.42.2 → 6.42.3
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.
- package/build/index.esm.js +13 -1
- package/build/index.esm.js.map +1 -1
- package/build/index.js +13 -1
- package/build/index.js.map +1 -1
- package/package.json +1 -1
package/build/index.esm.js
CHANGED
|
@@ -3120,11 +3120,23 @@ var formatPrice = function (value, _a) {
|
|
|
3120
3120
|
// this prevents `Intl.NumberFormat` from rounding the number
|
|
3121
3121
|
var valueToFormat = parseFloat("".concat(integer, ".").concat((_b = fraction === null || fraction === void 0 ? void 0 : fraction.slice(0, 2)) !== null && _b !== void 0 ? _b : 0));
|
|
3122
3122
|
var overridedLocale = (_c = localeOverrideByCurrency[currency]) !== null && _c !== void 0 ? _c : locale;
|
|
3123
|
-
|
|
3123
|
+
var result = new Intl.NumberFormat(overridedLocale, {
|
|
3124
3124
|
style: 'currency',
|
|
3125
3125
|
currency: currency,
|
|
3126
3126
|
maximumFractionDigits: 3,
|
|
3127
3127
|
}).format(valueToFormat);
|
|
3128
|
+
if (currency === 'NZD') {
|
|
3129
|
+
// intlFormat does not support NZD$ currency format
|
|
3130
|
+
var resultOverridden = result.replace('NZ$', 'NZD$');
|
|
3131
|
+
return resultOverridden;
|
|
3132
|
+
}
|
|
3133
|
+
if (currency === 'SGD') {
|
|
3134
|
+
// intlFormat does not support singapure currency
|
|
3135
|
+
var onlyValue = result.slice(result.indexOf('SGD') + 4);
|
|
3136
|
+
var resultOverridden = "SGD$".concat(onlyValue);
|
|
3137
|
+
return resultOverridden;
|
|
3138
|
+
}
|
|
3139
|
+
return result;
|
|
3128
3140
|
};
|
|
3129
3141
|
|
|
3130
3142
|
var CardSectionType;
|