Java Fraction Format format(double d)

Here you can find the source of format(double d)

Description

format

License

Open Source License

Declaration

public static String format(double d) 

Method Source Code

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

import java.text.DecimalFormat;

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

    public static String format(double d) {
        return formatter.format(d);
    }//ww w  .  ja  va2s  .  c o  m
}

Related

  1. format(double d)
  2. format(double d, DecimalFormat unitFormatter)
  3. format(Double d, int digit)
  4. format(double d, java.text.NumberFormat format)