← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 15829: Fixed bug - Programme validation rule exception with decimals.

 

------------------------------------------------------------
revno: 15829
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2014-06-24 20:33:37 +0800
message:
  Fixed bug -  Programme validation rule exception with decimals.
modified:
  dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/DefaultProgramValidationService.java


--
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-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/DefaultProgramValidationService.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/DefaultProgramValidationService.java	2014-06-23 13:01:57 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/DefaultProgramValidationService.java	2014-06-24 12:33:37 +0000
@@ -158,8 +158,8 @@
                 String expression = validate.getLeftSide().getExpression() + " " + validate.getRightSide().getExpression();
                 if ( isNumberDataExpression( expression ) )
                 {
-                    int leftSide = Integer.parseInt( leftSideValue );
-                    int rightSide = Integer.parseInt( rightSideValue );
+                    double leftSide = Double.parseDouble( leftSideValue );
+                    double rightSide = Double.parseDouble( rightSideValue );
                     if ( !((operator.equals( "==" ) && leftSide == rightSide)
                         || (operator.equals( "<" ) && leftSide < rightSide)
                         || (operator.equals( "<=" ) && leftSide <= rightSide)