Java Decimal Format to3DP(double number)

Here you can find the source of to3DP(double number)

Description

to DP

License

Open Source License

Declaration

public static double to3DP(double number) 

Method Source Code

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

import java.text.DecimalFormat;

public class Main {
    private static final DecimalFormat FORMAT = new DecimalFormat("#.####");

    public static double to3DP(double number) {
        return Double.valueOf(FORMAT.format(number));
    }//w w  w.  j a v a2s  .  c  om
}

Related

  1. replaceCommaByPoint(String doubleString, Locale loc)
  2. sanitizeDouble(String value)
  3. singleDecimalDigit(double d)
  4. string2Double(String s)
  5. strParaDouble(String s, double valorPadrao)
  6. toDecimalFromSexagesimalDegrees( final double sexagesimal)
  7. toDecimals(double d, int nrDecs)
  8. toDouble(Object obj, String pattern)
  9. toDouble(String text)