Java Fraction Format formatDouble(double d, int maximumFractionDigits)

Here you can find the source of formatDouble(double d, int maximumFractionDigits)

Description

format Double

License

Apache License

Declaration

public static String formatDouble(double d, int maximumFractionDigits) 

Method Source Code

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

import java.text.NumberFormat;

public class Main {

    public static String formatDouble(double d, int maximumFractionDigits) {
        NumberFormat format = NumberFormat.getNumberInstance();

        format.setMaximumFractionDigits(maximumFractionDigits);

        return format.format(d);
    }//from   w w w .j a v  a2s . co m
}

Related

  1. formatDouble(double d)
  2. formatDouble(double d)
  3. formatDouble(Double d)
  4. formatDouble(double d)
  5. formatDouble(Double d)
  6. formatDouble(Double d, NumberFormat format)
  7. formatDouble(Double doubleValue)
  8. formatDouble(Double in)
  9. formatDouble(double inVal, int inNumPlaces, boolean pad)