@fileverse-dev/formulajs 4.4.16 → 4.4.17
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/lib/browser/formula.js +16 -9
- package/lib/browser/formula.min.js +2 -2
- package/lib/browser/formula.min.js.map +1 -1
- package/lib/cjs/index.cjs +14 -9
- package/lib/esm/index.mjs +14 -9
- package/package.json +1 -1
package/lib/browser/formula.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @fileverse-dev/formulajs v4.4.
|
|
1
|
+
/* @fileverse-dev/formulajs v4.4.17 */
|
|
2
2
|
var _excluded = [ "confirmations", "dataDecoded" ];
|
|
3
3
|
|
|
4
4
|
function _objectWithoutProperties(e, t) {
|
|
@@ -18400,16 +18400,23 @@ function _typeof(o) {
|
|
|
18400
18400
|
ethereum: 1
|
|
18401
18401
|
};
|
|
18402
18402
|
function formatNumber(raw, decimals) {
|
|
18403
|
-
|
|
18403
|
+
try {
|
|
18404
|
+
if (!decimals) {
|
|
18405
|
+
return raw;
|
|
18406
|
+
}
|
|
18407
|
+
var quorum = BigInt(raw);
|
|
18408
|
+
var divisor = Math.pow(10, decimals);
|
|
18409
|
+
var normalized = Number(quorum) / divisor;
|
|
18410
|
+
return new Intl.NumberFormat("en-US", {
|
|
18411
|
+
notation: "compact",
|
|
18412
|
+
maximumFractionDigits: 2
|
|
18413
|
+
}).format(normalized);
|
|
18414
|
+
} catch (error) {
|
|
18415
|
+
console.log({
|
|
18416
|
+
error: error
|
|
18417
|
+
});
|
|
18404
18418
|
return raw;
|
|
18405
18419
|
}
|
|
18406
|
-
var quorum = BigInt(raw);
|
|
18407
|
-
var divisor = Math.pow(10, decimals);
|
|
18408
|
-
var normalized = Number(quorum) / divisor;
|
|
18409
|
-
return new Intl.NumberFormat("en-US", {
|
|
18410
|
-
notation: "compact",
|
|
18411
|
-
maximumFractionDigits: 2
|
|
18412
|
-
}).format(normalized);
|
|
18413
18420
|
}
|
|
18414
18421
|
var cachedChains = null;
|
|
18415
18422
|
function getChainName(_x16) {
|