Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ethersproject/bignumber

Package Overview
Dependencies
Maintainers
1
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ethersproject/bignumber - npm Package Compare versions

Comparing version 5.0.0-beta.122 to 5.0.0-beta.123

1

fixednumber.d.ts

@@ -25,2 +25,3 @@ import { BytesLike } from "@ethersproject/bytes";

divUnsafe(other: FixedNumber): FixedNumber;
round(decimals?: number): FixedNumber;
toString(): string;

@@ -27,0 +28,0 @@ toHexString(width?: number): string;

@@ -213,2 +213,21 @@ "use strict";

};
// @TODO: Support other rounding algorithms
FixedNumber.prototype.round = function (decimals) {
if (decimals == null) {
decimals = 0;
}
if (decimals < 0 || decimals > 80 || (decimals % 1)) {
errors.throwArgumentError("invalid decimal cound", "decimals", decimals);
}
// If we are already in range, we're done
var comps = this.toString().split(".");
if (comps[1].length <= decimals) {
return this;
}
// Bump the value up by the 0.00...0005
var bump = "0." + zeros.substring(0, decimals) + "5";
comps = this.addUnsafe(FixedNumber.fromString(bump, this.format))._value.split(".");
// Now it is safe to truncate
return FixedNumber.fromString(comps[0] + "." + comps[1].substring(0, decimals));
};
FixedNumber.prototype.toString = function () { return this._value; };

@@ -215,0 +234,0 @@ FixedNumber.prototype.toHexString = function (width) {

4

package.json
{
"name": "@ethersproject/bignumber",
"version": "5.0.0-beta.122",
"version": "5.0.0-beta.123",
"description": "BigNumber library used in ethers.js.",

@@ -25,3 +25,3 @@ "main": "index.js",

},
"tarballHash": "0x147f27db946bc64abf0b634712fa3faeadc2f4b31d44b5d9ed84602cb0c8be50"
"tarballHash": "0xc44f1d04b00cfe6b34f782630529956d529257c4162c0301e9e6426e989562ce"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc