Java Number Round roundToAccuracy(float n, float i)

Here you can find the source of roundToAccuracy(float n, float i)

Description

round To Accuracy

License

Open Source License

Declaration

private static float roundToAccuracy(float n, float i) 

Method Source Code

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

public class Main {
    private static float roundToAccuracy(float n, float i) {
        int cutoffN = (int) (n / i);
        return cutoffN * i;
    }//from w  w w .  ja  v a  2 s .com
}

Related

  1. roundTo2Decimals(double value)
  2. roundTo2Digits(double amount)
  3. roundTo2SigPlaces(double value)
  4. roundTo3Places(double n)
  5. roundTo6decimals(Double x)
  6. roundToBase(int a, int base)
  7. roundToBytes(int bitWidth)
  8. roundToDay(long time)
  9. roundToDecentPrecision(double value)