From 5c66d63fcaf0dd5cc70c0bd4504bb1c58ff524cd Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Tue, 24 Jul 2018 15:13:12 +0200 Subject: [PATCH] Leave some rounding error margin in comparison --- Assistant.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Assistant.js b/Assistant.js index 8f9bed000..32b181745 100644 --- a/Assistant.js +++ b/Assistant.js @@ -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);