Leave some rounding error margin in comparison

This commit is contained in:
Luis Fernando Molina committed 2018-07-24 15:13:12 +02:00
1 parent f1c429c6a2
commit 5c66d63fca
1 file changed
+1 -1
+1 -1
View File
@@ -737,7 +737,7 @@
sumAssetA = thisObject.truncDecimals(sumAssetA);
sumAssetB = thisObject.truncDecimals(sumAssetB);
if (thisObject.truncDecimals(position.amountA) !== sumAssetA || position.amountB !== sumAssetB) {
if (Math.abs(thisObject.truncDecimals(position.amountA) - sumAssetA) > 0.00000001 || Math.abs(position.amountB - sumAssetB) > 0.00000001) {
logger.write(MODULE_NAME, "[ERROR] ordersExecutionCheck -> loopBody -> confirmOrderWasPartiallyExecuted -> position.amountA = " + position.amountA);
logger.write(MODULE_NAME, "[ERROR] ordersExecutionCheck -> loopBody -> confirmOrderWasPartiallyExecuted -> sumAssetA = " + sumAssetA);