Java Double Number Format formatDouble(double value)

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

Description

format Double

License

Mozilla Public License

Declaration

public static final String formatDouble(double value) 

Method Source Code

//package com.java2s;
//This Source Code Form is subject to the terms of the Mozilla Public License, 

public class Main {
    public static final String formatDouble(double value) {
        return truncate("" + value, 4);
    }/*from  ww  w  .  j a va2  s .  c o  m*/

    public static final String truncate(String in, int length) {
        if (in.length() <= length) {
            return in;
        }
        return in.substring(0, length);
    }
}

Related

  1. formatDouble(double val)
  2. formatDouble(double val, int prec)
  3. formatDouble(double val, int precision)
  4. formatDouble(double value)
  5. formatDouble(double value)
  6. formatDouble(double value)
  7. formatDouble(double value, int decimals)
  8. formatDouble(final double value)
  9. formatDouble(final Object value)