Java Number Round roundTo6decimals(Double x)

Here you can find the source of roundTo6decimals(Double x)

Description

round Todecimals

License

Apache License

Declaration

private static Double roundTo6decimals(Double x) 

Method Source Code

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

public class Main {
    private static Double roundTo6decimals(Double x) {
        return x == null ? null : Math.round(x * Math.pow(10, 6)) / Math.pow(10, 6);
    }//  ww  w.  j  ava  2 s  . c o m
}

Related

  1. roundTo100th(double w)
  2. roundTo2Decimals(double value)
  3. roundTo2Digits(double amount)
  4. roundTo2SigPlaces(double value)
  5. roundTo3Places(double n)
  6. roundToAccuracy(float n, float i)
  7. roundToBase(int a, int base)
  8. roundToBytes(int bitWidth)
  9. roundToDay(long time)