List of utility methods to do Double Number Round
double | round(double number, int digits) round if (digits > 6) { return number; } else { double roundNumber = number; roundNumber *= Math.pow(10, digits); roundNumber = Math.round(roundNumber); roundNumber /= Math.pow(10, digits); return roundNumber; ... |
double | round(double number, int places) round assert places > 0; final double multiplier = Math.pow(10, places); return (int) (number * multiplier) / multiplier; |
double | round(double number, int places) Rounds a number to the given number places. final double power = Math.pow(10, places); number = number * power; final double value = Math.round(number); return value / power; |
double | round(double number, int precision) round int power = (int) Math.pow(10, precision); double num2 = Math.round(number * power); return num2 / power; |
Double | round(Double number, Integer precision) round Double retObj = null; if (number != null) { if (precision == null) precision = 0; Double decimalPlaces = Math.pow(10, precision); retObj = (double) Math.round(number * decimalPlaces) / decimalPlaces; return retObj; ... |
Object | round(Double ret, Integer doublePrecision) round return null;
|
double | round(double round, int decimal, int ceilOrFloor) round round *= (Math.pow(10, decimal)); if (ceilOrFloor == 0) { round = Math.ceil(round); } else { round = Math.floor(round); round /= (Math.pow(10, decimal)); return round; ... |
int[][] | round(double Rpred[][]) Round - simply round numbers (e.g., 2.0 to 2) -- for multi-target data (where we don't *yet* use a threshold). int Ypred[][] = new int[Rpred.length][Rpred[0].length]; for (int i = 0; i < Rpred.length; i++) { for (int j = 0; j < Rpred[i].length; j++) { Ypred[i][j] = (int) Math.round(Rpred[i][j]); return Ypred; |
double | Round(double Rval, int Rpl) Roundoff method. float p = (float) Math.pow(10, Rpl); Rval = Rval * p; float tmp = Math.round(Rval); return (double) tmp / p; |
double | round(double toRound) Rounds to two decimals. return Math.round(toRound * 100.0) / 100.0;
|