Java Fraction Format format(double val)

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

Description

Format decimals to 4 digits only

License

Open Source License

Declaration

public static String format(double val) 

Method Source Code

//package com.java2s;

import java.text.*;

public class Main {
    private static DecimalFormat df;

    /**//  w ww .ja va  2  s  . co m
     * Format decimals to 4 digits only
     */
    public static String format(double val) {
        return new String(df.format(val));
    }
}

Related

  1. format(double number)
  2. format(double number)
  3. format(double number, int digits)
  4. format(double number, String fmt)
  5. format(double price)
  6. format(double val)
  7. format(double val)
  8. format(double value)
  9. format(double value)