Skip to content
This repository was archived by the owner on Oct 30, 2023. It is now read-only.

Commit 28e1162

Browse files
authored
Fix TypeError by Kyzegs/master
2 parents d8adb12 + affa244 commit 28e1162

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

node-binance-api.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2578,7 +2578,7 @@ let api = function Binance( options = {} ) {
25782578
roundStep: function ( qty, stepSize ) {
25792579
// Integers do not require rounding
25802580
if ( Number.isInteger( qty ) ) return qty;
2581-
const qtyString = qty.toFixed( 16 );
2581+
const qtyString = parseFloat( qty ).toFixed( 16 );
25822582
const desiredDecimals = Math.max( stepSize.indexOf( '1' ) - 1, 0 );
25832583
const decimalIndex = qtyString.indexOf( '.' );
25842584
return parseFloat( qtyString.slice( 0, decimalIndex + desiredDecimals + 1 ) );

0 commit comments

Comments
 (0)