@wix/form-public 0.219.0 → 0.221.0

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/dist/index.js CHANGED
@@ -22888,7 +22888,7 @@ var require_messages_en = __commonJS({
22888
22888
  "dext-checkbox.input.error.message.not-allowed-value": "Check the box to continue.",
22889
22889
  "field.date.placeholder.year": "Year",
22890
22890
  "date-picker.input.error.message.max-value-error": "Enter a valid date from January 1, 1000 to today.",
22891
- "settings.score.input-label": "Points",
22891
+ "settings.score.input-label": "Points awarded",
22892
22892
  "field.signature.text.placeholder": "Type your signature",
22893
22893
  "dext-date-picker.input.error.message.format-error": "Choose a date.",
22894
22894
  "form.file-upload.error.upload-limit": "There is an upload limit of {limit, plural, one {# file} other {# files}}.",
@@ -26637,12 +26637,13 @@ function formatCurrency(_temp) {
26637
26637
  } = _temp === void 0 ? {} : _temp;
26638
26638
  const amountNumber = Number(amount);
26639
26639
  if (currency) {
26640
+ const fractionDigits = decimalCount ?? getDisplayPrecision(amountNumber);
26640
26641
  return Intl.NumberFormat(locale, {
26641
26642
  style: "currency",
26642
26643
  unitDisplay: "narrow",
26643
26644
  currency,
26644
- minimumFractionDigits: decimalCount,
26645
- maximumFractionDigits: decimalCount ?? getPrecision(amountNumber)
26645
+ minimumFractionDigits: fractionDigits,
26646
+ maximumFractionDigits: fractionDigits
26646
26647
  }).format(amountNumber);
26647
26648
  }
26648
26649
  if (decimalCount) {
@@ -26650,9 +26651,8 @@ function formatCurrency(_temp) {
26650
26651
  }
26651
26652
  return String(amount);
26652
26653
  }
26653
- function getPrecision(amount) {
26654
- var _amount$toString$spli;
26655
- return ((_amount$toString$spli = amount.toString().split(".")[1]) == null ? void 0 : _amount$toString$spli.length) || 0;
26654
+ function getDisplayPrecision(amount) {
26655
+ return Number.isInteger(amount) ? 0 : 2;
26656
26656
  }
26657
26657
 
26658
26658
  // ../../node_modules/libphonenumber-js/metadata.min.json.js