@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.js CHANGED
@@ -3146,11 +3146,23 @@ var formatPrice = function (value, _a) {
3146
3146
  // this prevents `Intl.NumberFormat` from rounding the number
3147
3147
  var valueToFormat = parseFloat("".concat(integer, ".").concat((_b = fraction === null || fraction === void 0 ? void 0 : fraction.slice(0, 2)) !== null && _b !== void 0 ? _b : 0));
3148
3148
  var overridedLocale = (_c = localeOverrideByCurrency[currency]) !== null && _c !== void 0 ? _c : locale;
3149
- return new Intl.NumberFormat(overridedLocale, {
3149
+ var result = new Intl.NumberFormat(overridedLocale, {
3150
3150
  style: 'currency',
3151
3151
  currency: currency,
3152
3152
  maximumFractionDigits: 3,
3153
3153
  }).format(valueToFormat);
3154
+ if (currency === 'NZD') {
3155
+ // intlFormat does not support NZD$ currency format
3156
+ var resultOverridden = result.replace('NZ$', 'NZD$');
3157
+ return resultOverridden;
3158
+ }
3159
+ if (currency === 'SGD') {
3160
+ // intlFormat does not support singapure currency
3161
+ var onlyValue = result.slice(result.indexOf('SGD') + 4);
3162
+ var resultOverridden = "SGD$".concat(onlyValue);
3163
+ return resultOverridden;
3164
+ }
3165
+ return result;
3154
3166
  };
3155
3167
 
3156
3168
  exports.CardSectionType = void 0;