@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.cjs CHANGED
@@ -22914,7 +22914,7 @@ var require_messages_en = __commonJS({
22914
22914
  "dext-checkbox.input.error.message.not-allowed-value": "Check the box to continue.",
22915
22915
  "field.date.placeholder.year": "Year",
22916
22916
  "date-picker.input.error.message.max-value-error": "Enter a valid date from January 1, 1000 to today.",
22917
- "settings.score.input-label": "Points",
22917
+ "settings.score.input-label": "Points awarded",
22918
22918
  "field.signature.text.placeholder": "Type your signature",
22919
22919
  "dext-date-picker.input.error.message.format-error": "Choose a date.",
22920
22920
  "form.file-upload.error.upload-limit": "There is an upload limit of {limit, plural, one {# file} other {# files}}.",
@@ -26663,12 +26663,13 @@ function formatCurrency(_temp) {
26663
26663
  } = _temp === void 0 ? {} : _temp;
26664
26664
  const amountNumber = Number(amount);
26665
26665
  if (currency) {
26666
+ const fractionDigits = decimalCount ?? getDisplayPrecision(amountNumber);
26666
26667
  return Intl.NumberFormat(locale, {
26667
26668
  style: "currency",
26668
26669
  unitDisplay: "narrow",
26669
26670
  currency,
26670
- minimumFractionDigits: decimalCount,
26671
- maximumFractionDigits: decimalCount ?? getPrecision(amountNumber)
26671
+ minimumFractionDigits: fractionDigits,
26672
+ maximumFractionDigits: fractionDigits
26672
26673
  }).format(amountNumber);
26673
26674
  }
26674
26675
  if (decimalCount) {
@@ -26676,9 +26677,8 @@ function formatCurrency(_temp) {
26676
26677
  }
26677
26678
  return String(amount);
26678
26679
  }
26679
- function getPrecision(amount) {
26680
- var _amount$toString$spli;
26681
- return ((_amount$toString$spli = amount.toString().split(".")[1]) == null ? void 0 : _amount$toString$spli.length) || 0;
26680
+ function getDisplayPrecision(amount) {
26681
+ return Number.isInteger(amount) ? 0 : 2;
26682
26682
  }
26683
26683
 
26684
26684
  // ../../node_modules/libphonenumber-js/metadata.min.json.js