@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.bundle.js +1 -1
- package/dist/esm/index.js +16 -20
- package/dist/umd/index.bundle.js +1 -1
- package/dist/umd/index.js +16 -20
- package/package.json +1 -1
package/dist/umd/index.js
CHANGED
|
@@ -1622,15 +1622,11 @@
|
|
|
1622
1622
|
|
|
1623
1623
|
var direction = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'up';
|
|
1624
1624
|
var inputAsFloat = parseFloat(input);
|
|
1625
|
-
var digitsAfterDecimal = inputAsFloat.toString().match(/\d+\.0*(\d{
|
|
1625
|
+
var digitsAfterDecimal = inputAsFloat.toString().match(/\d+\.0*(\d{5})/);
|
|
1626
1626
|
|
|
1627
1627
|
if ((_digitsAfterDecimal = digitsAfterDecimal) !== null && _digitsAfterDecimal !== void 0 && _digitsAfterDecimal.length) {
|
|
1628
1628
|
digitsAfterDecimal = digitsAfterDecimal[0];
|
|
1629
|
-
var focus = digitsAfterDecimal.match(/\d{
|
|
1630
|
-
|
|
1631
|
-
if (focus.match(/^00/)) {
|
|
1632
|
-
return inputAsFloat;
|
|
1633
|
-
}
|
|
1629
|
+
var focus = digitsAfterDecimal.match(/\d{5}$/)[0];
|
|
1634
1630
|
|
|
1635
1631
|
var _float;
|
|
1636
1632
|
|
|
@@ -1638,35 +1634,35 @@
|
|
|
1638
1634
|
|
|
1639
1635
|
if (focus.match(/^0/)) {
|
|
1640
1636
|
if (direction == 'up') {
|
|
1641
|
-
_float = parseFloat("".concat(focus[1], ".").concat(focus[2]));
|
|
1637
|
+
_float = parseFloat("".concat(focus[1], ".").concat(focus[2]).concat(focus[3]).concat(focus[4]));
|
|
1642
1638
|
} else {
|
|
1643
|
-
_float = parseFloat("".concat(focus[1], ".").concat(focus[2]));
|
|
1639
|
+
_float = parseFloat("".concat(focus[1], ".").concat(focus[2]).concat(focus[3]).concat(focus[4]));
|
|
1644
1640
|
}
|
|
1645
1641
|
|
|
1646
|
-
focusToFixed = parseFloat(_float).toFixed(
|
|
1642
|
+
focusToFixed = parseFloat(_float).toFixed(3);
|
|
1647
1643
|
focusToFixed = "0".concat(focusToFixed).replace('.', '');
|
|
1648
1644
|
} else {
|
|
1649
1645
|
if (direction == 'up') {
|
|
1650
|
-
_float = parseFloat("".concat(focus[0], ".").concat(focus[1], "9"));
|
|
1646
|
+
_float = parseFloat("".concat(focus[0], ".").concat(focus[1]).concat(focus[2]).concat(focus[3], "9"));
|
|
1651
1647
|
} else {
|
|
1652
|
-
_float = parseFloat("".concat(focus[0], ".").concat(focus[1], "1"));
|
|
1648
|
+
_float = parseFloat("".concat(focus[0], ".").concat(focus[1]).concat(focus[2]).concat(focus[3], "1"));
|
|
1653
1649
|
}
|
|
1654
1650
|
|
|
1655
|
-
focusToFixed = parseFloat(_float).toFixed(
|
|
1651
|
+
focusToFixed = parseFloat(_float).toFixed(3).replace('.', '');
|
|
1656
1652
|
}
|
|
1657
1653
|
|
|
1658
|
-
if (focusToFixed == '
|
|
1659
|
-
focusToFixed = direction == 'up' ? '
|
|
1660
|
-
return parseFloat(digitsAfterDecimal.replace(/\d{
|
|
1661
|
-
} else if (focusToFixed == '
|
|
1662
|
-
return parseFloat(digitsAfterDecimal.replace(/\d{
|
|
1663
|
-
} else if (focusToFixed.toString()[0] != "0" && focusToFixed.toString().length >
|
|
1654
|
+
if (focusToFixed == '09999' && parseInt(inputAsFloat.toFixed(0)) == 0) {
|
|
1655
|
+
focusToFixed = direction == 'up' ? '10000' : '09999';
|
|
1656
|
+
return parseFloat(digitsAfterDecimal.replace(/\d{5}$/, focusToFixed));
|
|
1657
|
+
} else if (focusToFixed == '10000' && parseInt(inputAsFloat.toFixed(0)) == 0) {
|
|
1658
|
+
return parseFloat(digitsAfterDecimal.replace(/\d{6}$/, focusToFixed));
|
|
1659
|
+
} else if (focusToFixed.toString()[0] != "0" && focusToFixed.toString().length > 4) {
|
|
1664
1660
|
return parseInt(inputAsFloat.toFixed(0));
|
|
1665
1661
|
} else {
|
|
1666
|
-
return parseFloat(digitsAfterDecimal.replace(/\d{
|
|
1662
|
+
return parseFloat(digitsAfterDecimal.replace(/\d{5}$/, focusToFixed));
|
|
1667
1663
|
}
|
|
1668
1664
|
} else {
|
|
1669
|
-
return parseFloat(inputAsFloat.toFixed(
|
|
1665
|
+
return parseFloat(inputAsFloat.toFixed(4));
|
|
1670
1666
|
}
|
|
1671
1667
|
});
|
|
1672
1668
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@depay/widgets",
|
|
3
3
|
"moduleName": "DePayWidgets",
|
|
4
|
-
"version": "7.16.
|
|
4
|
+
"version": "7.16.2",
|
|
5
5
|
"description": "Web3 Payments with any token. DePay simplifies and improves Web3 Payments with the power of DeFi. Accept any token with on-the-fly conversion.",
|
|
6
6
|
"main": "./dist/umd/index.js",
|
|
7
7
|
"module": "./dist/esm/index.js",
|