← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 19674: rule engine evaluation result now gets rounded to two decimals

 

------------------------------------------------------------
revno: 19674
committer: Abyot Asalefew Gizaw <abyota@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2015-07-17 10:14:27 +0200
message:
  rule engine evaluation result now gets rounded to two decimals
modified:
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.angular.services.js


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.angular.services.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.angular.services.js	2015-07-15 14:30:32 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.angular.services.js	2015-07-17 08:14:27 +0000
@@ -1107,6 +1107,9 @@
             var dhisfunctionsevaluated = runDhisFunctions(expression, variablesHash, flag);
             answer = eval(dhisfunctionsevaluated);
         }
+        if(dhis2.validation.isNumber(answer)){
+            answer = Number(answer).toFixed(2);
+        }
         return answer;
     };