Java Fraction Format formatDouble(double orig)

Here you can find the source of formatDouble(double orig)

Description

format Double

License

Apache License

Declaration

public static double formatDouble(double orig) 

Method Source Code


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

import java.text.DecimalFormat;

public class Main {
    public static double formatDouble(double orig) {
        DecimalFormat df = new DecimalFormat("######0.000");
        return Double.valueOf(df.format(orig)).doubleValue();
    }//  w ww . j  a v  a2s .  c  o m
}

Related

  1. formatdouble(double number)
  2. formatDouble(double number)
  3. formatDouble(double number)
  4. formatDouble(double number, int decimalDigits)
  5. formatDouble(double number, int integerDigits, int fractionDigits)
  6. formatDouble(Double someDouble)
  7. formatDouble(Double v)
  8. formatDouble(double value)
  9. formatDouble(double value)