AlgoTrader / betfair

Betfair API-NG library for node.js
96 stars 46 forks source link

Increase/decrease BF price: rounding error #3

Closed jvolhejn closed 10 years ago

jvolhejn commented 10 years ago

betfair_price.js: methods increasePrice and decreasePrice give in some cases non-Betfair price due to rounding:

x = 4.6 4.6 x += 0.1 4.699999999999999

Can be fixed like in the setStake method:

x = Math.round(x * 10) / 10 4.7

AlgoTrader commented 10 years ago

fixed