@depay/widgets 7.16.1 → 7.16.2

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/esm/index.js CHANGED
@@ -1627,15 +1627,11 @@ var round = (function (input) {
1627
1627
 
1628
1628
  var direction = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'up';
1629
1629
  var inputAsFloat = parseFloat(input);
1630
- var digitsAfterDecimal = inputAsFloat.toString().match(/\d+\.0*(\d{3})/);
1630
+ var digitsAfterDecimal = inputAsFloat.toString().match(/\d+\.0*(\d{5})/);
1631
1631
 
1632
1632
  if ((_digitsAfterDecimal = digitsAfterDecimal) !== null && _digitsAfterDecimal !== void 0 && _digitsAfterDecimal.length) {
1633
1633
  digitsAfterDecimal = digitsAfterDecimal[0];
1634
- var focus = digitsAfterDecimal.match(/\d{3}$/)[0];
1635
-
1636
- if (focus.match(/^00/)) {
1637
- return inputAsFloat;
1638
- }
1634
+ var focus = digitsAfterDecimal.match(/\d{5}$/)[0];
1639
1635
 
1640
1636
  var _float;
1641
1637
 
@@ -1643,35 +1639,35 @@ var round = (function (input) {
1643
1639
 
1644
1640
  if (focus.match(/^0/)) {
1645
1641
  if (direction == 'up') {
1646
- _float = parseFloat("".concat(focus[1], ".").concat(focus[2]));
1642
+ _float = parseFloat("".concat(focus[1], ".").concat(focus[2]).concat(focus[3]).concat(focus[4]));
1647
1643
  } else {
1648
- _float = parseFloat("".concat(focus[1], ".").concat(focus[2]));
1644
+ _float = parseFloat("".concat(focus[1], ".").concat(focus[2]).concat(focus[3]).concat(focus[4]));
1649
1645
  }
1650
1646
 
1651
- focusToFixed = parseFloat(_float).toFixed(1);
1647
+ focusToFixed = parseFloat(_float).toFixed(3);
1652
1648
  focusToFixed = "0".concat(focusToFixed).replace('.', '');
1653
1649
  } else {
1654
1650
  if (direction == 'up') {
1655
- _float = parseFloat("".concat(focus[0], ".").concat(focus[1], "9"));
1651
+ _float = parseFloat("".concat(focus[0], ".").concat(focus[1]).concat(focus[2]).concat(focus[3], "9"));
1656
1652
  } else {
1657
- _float = parseFloat("".concat(focus[0], ".").concat(focus[1], "1"));
1653
+ _float = parseFloat("".concat(focus[0], ".").concat(focus[1]).concat(focus[2]).concat(focus[3], "1"));
1658
1654
  }
1659
1655
 
1660
- focusToFixed = parseFloat(_float).toFixed(1).replace('.', '');
1656
+ focusToFixed = parseFloat(_float).toFixed(3).replace('.', '');
1661
1657
  }
1662
1658
 
1663
- if (focusToFixed == '099' && parseInt(inputAsFloat.toFixed(0)) == 0) {
1664
- focusToFixed = direction == 'up' ? '100' : '990';
1665
- return parseFloat(digitsAfterDecimal.replace(/\d{3}$/, focusToFixed));
1666
- } else if (focusToFixed == '100' && parseInt(inputAsFloat.toFixed(0)) == 0) {
1667
- return parseFloat(digitsAfterDecimal.replace(/\d{4}$/, focusToFixed));
1668
- } else if (focusToFixed.toString()[0] != "0" && focusToFixed.toString().length > 2) {
1659
+ if (focusToFixed == '09999' && parseInt(inputAsFloat.toFixed(0)) == 0) {
1660
+ focusToFixed = direction == 'up' ? '10000' : '09999';
1661
+ return parseFloat(digitsAfterDecimal.replace(/\d{5}$/, focusToFixed));
1662
+ } else if (focusToFixed == '10000' && parseInt(inputAsFloat.toFixed(0)) == 0) {
1663
+ return parseFloat(digitsAfterDecimal.replace(/\d{6}$/, focusToFixed));
1664
+ } else if (focusToFixed.toString()[0] != "0" && focusToFixed.toString().length > 4) {
1669
1665
  return parseInt(inputAsFloat.toFixed(0));
1670
1666
  } else {
1671
- return parseFloat(digitsAfterDecimal.replace(/\d{3}$/, focusToFixed));
1667
+ return parseFloat(digitsAfterDecimal.replace(/\d{5}$/, focusToFixed));
1672
1668
  }
1673
1669
  } else {
1674
- return parseFloat(inputAsFloat.toFixed(2));
1670
+ return parseFloat(inputAsFloat.toFixed(4));
1675
1671
  }
1676
1672
  });
1677
1673