Skip to content

Commit 3b817af

Browse files
committed
Fix rounding error
1 parent d37269e commit 3b817af

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/market_helper.coffee

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ MarketHelper =
6060
parseFloat math.divide(@toBignum(value), @toBignum(100000000))
6161

6262
multiplyBigints: (value, value2)->
63-
parseInt math.divide(math.multiply(@toBignum(value), @toBignum(value2)), @toBignum(100000000))
63+
parseInt math.round math.divide(math.multiply(@toBignum(value), @toBignum(value2)), @toBignum(100000000))
6464

6565
getEventType: (type)->
6666
EVENT_TYPE[type]

lib/market_helper.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
return parseFloat(math.divide(this.toBignum(value), this.toBignum(100000000)));
6969
},
7070
multiplyBigints: function(value, value2) {
71-
return parseInt(math.divide(math.multiply(this.toBignum(value), this.toBignum(value2)), this.toBignum(100000000)));
71+
return parseInt(math.round(math.divide(math.multiply(this.toBignum(value), this.toBignum(value2)), this.toBignum(100000000))));
7272
},
7373
getEventType: function(type) {
7474
return EVENT_TYPE[type];

0 commit comments

Comments
 (0)