From 68a9c1aafd39cbc65ce027676f64ecc985375a7b Mon Sep 17 00:00:00 2001 From: Dante Date: Tue, 26 May 2015 16:32:46 -0400 Subject: [PATCH] rounding two 2 decimals the indicator's old value --- .../engine/js/strategicDashboard/viewDashboardPresenter.js | 5 ++++- .../engine/templates/strategicDashboard/viewDashboard.html | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/workflow/engine/js/strategicDashboard/viewDashboardPresenter.js b/workflow/engine/js/strategicDashboard/viewDashboardPresenter.js index 449a8ccd5..b7905e6ef 100644 --- a/workflow/engine/js/strategicDashboard/viewDashboardPresenter.js +++ b/workflow/engine/js/strategicDashboard/viewDashboardPresenter.js @@ -70,7 +70,6 @@ ViewDashboardPresenter.prototype.dashboardIndicatorsViewModel = function(data) { "DAS_IND_PERCENT_VARIATION" : "percentComparative", "DAS_IND_DIRECTION" : "direction", "DAS_IND_VALUE" : "value", - "DAS_IND_OLD_VALUE" : "oldValue", "DAS_IND_X" : "x", "DAS_IND_Y" : "y", "DAS_IND_WIDTH" : "width", @@ -109,6 +108,10 @@ ViewDashboardPresenter.prototype.dashboardIndicatorsViewModel = function(data) { : newObject.percentComparative; newObject.value = that.roundedIndicatorValue(newObject.value); + + //we don't use the database values to avoid rounding differences + newObject.oldValue = newObject.value - newObject.comparative + newObject.favorite = 0; that.setStatusButtonWidthsAndDisplayValues(newObject); diff --git a/workflow/engine/templates/strategicDashboard/viewDashboard.html b/workflow/engine/templates/strategicDashboard/viewDashboard.html index 39705503d..58b11bc69 100644 --- a/workflow/engine/templates/strategicDashboard/viewDashboard.html +++ b/workflow/engine/templates/strategicDashboard/viewDashboard.html @@ -53,10 +53,11 @@
<%- indicator.value %>
+
<%- indicator.oldValue %>
- <%- indicator.comparative %> <%- indicator.percentComparative %> + <%- indicator.oldValue %> <%- indicator.comparative %> <%- indicator.percentComparative %>