------------------------------------------------------------
revno: 2339
committer: Lars Helge Overland <[email protected]>
branch nick: dhis2
timestamp: Sat 2010-12-11 19:52:11 +0100
message:
  Displaying only 1 decimal in validation rule violations. There might be 
decimal numbers here since the validation formula can include multiplication 
with percentages etc.
modified:
  
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/validation/DefaultValidationRuleService.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-core/src/main/java/org/hisp/dhis/validation/DefaultValidationRuleService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/validation/DefaultValidationRuleService.java	2010-12-03 16:15:40 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/validation/DefaultValidationRuleService.java	2010-12-11 18:52:11 +0000
@@ -65,6 +65,8 @@
 {
     private static final Log log = LogFactory.getLog( DefaultValidationRuleService.class );
     
+    private static final int DECIMALS = 1;
+    
     // -------------------------------------------------------------------------
     // Dependencies
     // -------------------------------------------------------------------------
@@ -319,7 +321,7 @@
     
                     if ( violation )
                     {
-                        validationResults.add( new ValidationResult( period, source, validationRule, leftSide, rightSide ) );
+                        validationResults.add( new ValidationResult( period, source, validationRule, MathUtils.getRounded( leftSide, DECIMALS ), MathUtils.getRounded( rightSide, DECIMALS ) ) );
                     }
                 }
             }

_______________________________________________
Mailing list: https://launchpad.net/~dhis2-devs
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp

Reply via email to