Java Number Round roundTo(float number, int base)

Here you can find the source of roundTo(float number, int base)

Description

round To

License

Open Source License

Declaration

public static float roundTo(float number, int base) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static float roundTo(float number, int base) {
        return Math.round(number * 10 * base) / (10f * base);
    }/*w  w  w. ja  v a2  s .  co m*/
}

Related

  1. roundTo(double aValue, int aDigits)
  2. roundTo(double d, int n)
  3. roundTo(double num, int dp)
  4. roundTo(double val, double prec)
  5. roundTo(final double VALUE, final double TARGET)
  6. roundTo(float number, int numPlaces)
  7. roundTo(float val, int numPlaces)
  8. roundTo100th(double w)
  9. roundTo2Decimals(double value)