Java Fraction Format format(final double number)

Here you can find the source of format(final double number)

Description

format

License

Apache License

Declaration

public static String format(final double number) 

Method Source Code


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

import java.text.DecimalFormat;

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

    public static String format(final float number) {

        return DEFAULT_FORMAT.format(number);
    }//from  w ww. jav a  2  s .  c  o  m

    public static String format(final double number) {

        return DEFAULT_FORMAT.format(number);
    }
}

Related

  1. format(double value, double unit)
  2. format(double value, int decimalPlace)
  3. format(double value, String formatString)
  4. format(double x, int max, int min)
  5. format(final double d)
  6. format(final double value)
  7. format(final double value, final int decimalPlaces)
  8. format(final NumberFormat fmt, final double val)
  9. format(float f)