From 3f6381be7a1a04a0170873bf7b71e9562d479c31 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Sat, 30 Jun 2018 08:13:04 +0200 Subject: [PATCH] 2 decimals for right scale --- CloudVM/PoloniexAPIClient.js | 10 ++++++---- Scales/ChartGrid.js | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/CloudVM/PoloniexAPIClient.js b/CloudVM/PoloniexAPIClient.js index e6a990643..1de057e70 100644 --- a/CloudVM/PoloniexAPIClient.js +++ b/CloudVM/PoloniexAPIClient.js @@ -21,6 +21,8 @@ function analizeResponse(logger, exchangeErr, exchangeResponse, notOkCallBack, okCallBack) { + /* IMPORTANT> This function is an exact copy of the one running at the cloud, with a browsery applied. In this case it means the world global -> window. */ + /* This function analizes the different situations we might encounter trying to access Poloniex and returns appropiate standard errors. */ try { @@ -43,7 +45,7 @@ stringExchangeResponse.indexOf("Internal error. Please try again") > 0))) { logger.write( MODULE_NAME, "[WARN] analizeResponse -> Timeout reached or connection problem while trying to access the Exchange API. Requesting new execution later."); - notOkCallBack(global.DEFAULT_RETRY_RESPONSE); + notOkCallBack(window.DEFAULT_RETRY_RESPONSE); return; } else { @@ -54,7 +56,7 @@ logger.write( MODULE_NAME, "[ERROR] analizeResponse -> Unexpected response from the Exchange."); logger.write( MODULE_NAME, "[ERROR] analizeResponse -> exchangeResponse = " + stringExchangeResponse); - notOkCallBack(global.DEFAULT_FAIL_RESPONSE); + notOkCallBack(window.DEFAULT_FAIL_RESPONSE); return; } } @@ -62,7 +64,7 @@ if (exchangeErr) { logger.write( MODULE_NAME, "[ERROR] analizeResponse -> Unexpected error trying to contact the Exchange."); - notOkCallBack(global.DEFAULT_FAIL_RESPONSE); + notOkCallBack(window.DEFAULT_FAIL_RESPONSE); return; } else { @@ -75,7 +77,7 @@ } catch (err) { logger.write( MODULE_NAME, "[ERROR] analizeResponse -> err.message = " + err.message); - notOkCallBack(global.DEFAULT_FAIL_RESPONSE); + notOkCallBack(window.DEFAULT_FAIL_RESPONSE); return; } } diff --git a/Scales/ChartGrid.js b/Scales/ChartGrid.js index 2b76be1e0..2f0323659 100644 --- a/Scales/ChartGrid.js +++ b/Scales/ChartGrid.js @@ -586,7 +586,7 @@ */ let labelValue = (j - timeLineCoordinateSystem.max.y / 2) * 200 / timeLineCoordinateSystem.max.y; - labelValue = Math.round(labelValue * 1) / 1; + labelValue = Math.round(labelValue * 100) / 100; if (labelValue > 0) { labelValue = '+' + labelValue; } if (parseInt(labelValue) > -10 && parseInt(labelValue) < 10) { labelValue = ' ' + labelValue; } if (parseInt(labelValue) === 0) { labelValue = ' ' + labelValue; }