Java Number Round roundTo3Places(double n)

Here you can find the source of roundTo3Places(double n)

Description

round To Places

License

BSD License

Declaration

public static double roundTo3Places(double n) 

Method Source Code

//package com.java2s;
//License from project: BSD License 

public class Main {
    public static double roundTo3Places(double n) {
        return Math.round(n * 1000d) * 0.001;
    }/*  w ww .  j  a v a 2s  .  c om*/
}

Related

  1. roundTo(float val, int numPlaces)
  2. roundTo100th(double w)
  3. roundTo2Decimals(double value)
  4. roundTo2Digits(double amount)
  5. roundTo2SigPlaces(double value)
  6. roundTo6decimals(Double x)
  7. roundToAccuracy(float n, float i)
  8. roundToBase(int a, int base)
  9. roundToBytes(int bitWidth)