dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #09116
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2340: Minor fix
------------------------------------------------------------
revno: 2340
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Sat 2010-12-11 20:58:29 +0100
message:
Minor fix
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-11 18:52:11 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/validation/DefaultValidationRuleService.java 2010-12-11 19:58:29 +0000
@@ -28,7 +28,7 @@
*/
import static org.hisp.dhis.system.util.MathUtils.expressionIsTrue;
-
+import static org.hisp.dhis.system.util.MathUtils.getRounded;
import java.util.Collection;
import java.util.Date;
import java.util.HashSet;
@@ -51,7 +51,6 @@
import org.hisp.dhis.system.util.CompositeCounter;
import org.hisp.dhis.system.util.Filter;
import org.hisp.dhis.system.util.FilterUtils;
-import org.hisp.dhis.system.util.MathUtils;
import org.springframework.transaction.annotation.Transactional;
/**
@@ -147,7 +146,7 @@
{
double percentage = (double) ( 100 * counter.getCount( period, source ) ) / number;
- grid.addValue( String.valueOf( MathUtils.getRounded( percentage, 1 ) ) );
+ grid.addValue( String.valueOf( getRounded( percentage, DECIMALS ) ) );
}
}
@@ -321,7 +320,7 @@
if ( violation )
{
- validationResults.add( new ValidationResult( period, source, validationRule, MathUtils.getRounded( leftSide, DECIMALS ), MathUtils.getRounded( rightSide, DECIMALS ) ) );
+ validationResults.add( new ValidationResult( period, source, validationRule, getRounded( leftSide, DECIMALS ), getRounded( rightSide, DECIMALS ) ) );
}
}
}