=== modified file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/MathUtils.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/MathUtils.java 2014-09-19 13:35:52 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/MathUtils.java 2014-11-02 22:01:27 +0000
@@ -173,7 +173,7 @@
}
/**
- * Return a rounded off number.
+ * Returns a rounded off number.
*
*
* - If value is exclusively between 1 and -1 it will have 2 decimals.
@@ -196,6 +196,17 @@
}
/**
+ * Returns a rounded off number. If the value class is not Double, the value
+ * is returned unchanged.
+ *
+ * @param value the value to return and potentially round off.
+ */
+ public static Object getRounded( Object value )
+ {
+ return value != null && Double.class.equals( value.getClass() ) ? getRounded( (Double) value ) : value;
+ }
+
+ /**
* Rounds a number, keeping at least 3 significant digits.
*
*