Open cyri113 opened 4 years ago
Hello,
I am getting the following error.
TypeError: Cannot read property 'length' of undefined at Object.roundTicks (/backend/node_modules/node-binance-api/node-binance-api.js:1550:75)
It occurs when the tickSize=1.00000000. I overcame this by modifying the roundTicks function in the following manner:
tickSize=1.00000000
const roundTicks = (price, tickSize) => { const formatter = new Intl.NumberFormat('en-US', { style: 'decimal', minimumFractionDigits: 0, maximumFractionDigits: 8 }) const value = formatter.format(tickSize).split('.')[1] const precision = value === undefined ? 0 : value.length if (typeof price === 'string') price = parseFloat(price); return price.toFixed(precision) }
I hope this helps the community! Thank you for the API!
thank you for your contribution 👍
The problem is still relevant for tickSize = 1, but the code suggested above works
Hello,
I am getting the following error.
It occurs when the
tickSize=1.00000000
. I overcame this by modifying the roundTicks function in the following manner:I hope this helps the community! Thank you for the API!