Java Number Round rounder(float value, int digits)

Here you can find the source of rounder(float value, int digits)

Description

rounder

License

Open Source License

Declaration

public static float rounder(float value, int digits) 

Method Source Code

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

public class Main {
    public static float rounder(float value, int digits) {
        // rounds value to digits behind the decimal point

        return Math.round(value * Math.pow(10, digits) + 0.5) / (float) Math.pow(10, digits);
    }// ww  w .  j  av a2 s.c  om
}

Related

  1. roundedApply(double value, double percent, double delta)
  2. roundedDollarValue(double d)
  3. roundedLog(double value, double exponent)
  4. roundedLog10(int n)
  5. roundedSatisfaction(double value)
  6. roundf(float value)
  7. roundFileLength(long nbytes)
  8. roundFloat(float value, int afterDecimalPoint)
  9. roundFloatToPlace(float f, int place)