Java Double Number Format getValidString(Double value, DecimalFormat formatter)

Here you can find the source of getValidString(Double value, DecimalFormat formatter)

Description

get Valid String

License

Open Source License

Declaration

public static String getValidString(Double value, DecimalFormat formatter) 

Method Source Code


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

import java.text.DecimalFormat;

public class Main {
    public static String getValidString(Double value, DecimalFormat formatter) {
        String str = "";
        if (value == null || Double.isNaN(value))
            str = "NaN";
        else//w  w w .  j a  v  a2 s.co  m
            str = formatter.format(value) + "";
        return str;
    }
}

Related

  1. getFormattedNumber(Double number, int decimals, Locale locale)
  2. getFormattedString(double d, int numDecimalPlaces)
  3. getFormattedTwoDecimal(double d)
  4. getFormattedValue(double argDoubleValue)
  5. getTwoDecimalByDecimalFormat(double number)
  6. isDoubleWhitFormat(String pValue)
  7. prettyDecimalFormat(double d, int numPlaces)
  8. roundFormat(double d, int i)
  9. shorten(double num)