big-order-book 1.0.3 → 2.0.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.
Files changed (2) hide show
  1. package/index.js +2 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -145,11 +145,11 @@ class BigOrderBook {
145
145
  }
146
146
 
147
147
  _convertSizeToValue(size, price) {
148
- return size * BigInt(Math.floor(price * this.pricePrecisionFactor)) / BigInt(this.pricePrecisionFactor);
148
+ return size * BigInt(Math.round(price * this.pricePrecisionFactor)) / BigInt(this.pricePrecisionFactor);
149
149
  }
150
150
 
151
151
  _convertValueToSize(value, price) {
152
- return value * BigInt(this.pricePrecisionFactor) / BigInt(Math.floor(price * this.pricePrecisionFactor));
152
+ return value * BigInt(this.pricePrecisionFactor) / BigInt(Math.round(price * this.pricePrecisionFactor));
153
153
  }
154
154
 
155
155
  _addAsk(ask) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "big-order-book",
3
- "version": "1.0.3",
3
+ "version": "2.0.0",
4
4
  "description": "An efficient order book which supports market and limit orders with fast insertion and search - Works with the BigInt type.",
5
5
  "main": "index.js",
6
6
  "scripts": {