Java Utililty Methods Double Number to String

List of utility methods to do Double Number to String

Description

The list of methods to do Double Number to String are organized into topic(s).

Method

Stringdouble2String(double d)
double String
return (double2String(d, 5));
Stringdouble2String(double value)
double String
DecimalFormat format = new DecimalFormat("0.##");
DecimalFormatSymbols symbols = format.getDecimalFormatSymbols();
symbols.setDecimalSeparator('.');
format.setDecimalFormatSymbols(symbols);
format.setDecimalSeparatorAlwaysShown(false);
return format.format(value);
String[]doublesToStrings(final double... numbers)
doubles To Strings
if (numbers == null) {
    return null;
final String[] strings = new String[numbers.length];
int index = 0;
for (final double number : numbers) {
    strings[index++] = doubleToString(number);
return strings;
StringdoubleToAtLeastString(double d, int length)
return a string that is at least a certain number of characters in length.
NumberFormat formatter = new DecimalFormat("0.000");
String s = formatter.format(d);
for (int i = s.length(); i < length; i++) {
    s += "0";
return s;
StringdoubleToCoreString(double number)
double To Core String
return coreDoubleFormat_.format(number);
StringdoubleToDollarString(double val)
double To Dollar String
return NumberFormat.getCurrencyInstance().format(val);
StringdoubleToFixedString(double d, int length)
double To Fixed String
String s = doubleToAtLeastString(d, length);
if (s.charAt(0) != '-') {
    return " " + s.substring(0, length - 1);
return s.substring(0, length);
StringdoubleToScientificString(double number, int fractionDigits)
Returns the string representation of the given double value in normalized scientific notation.
DecimalFormat format = new DecimalFormat();
StringBuilder formatter = new StringBuilder(5 + fractionDigits).append("0.");
for (int i = 0; i < fractionDigits; i++) {
    formatter.append('0');
formatter.append("E00");
format.applyPattern(formatter.toString());
String formatted = format.format(number);
...
StringdoubleToStr(double d)
double To Str
String rtn = "";
java.text.DecimalFormat df = new java.text.DecimalFormat("###0.000000");
rtn = df.format(d);
return cutZero(rtn);
StringdoubleToStr(double origin, int decimals)
Formats a double to produce a string with a number of fraction digits.
return getFormat(decimals).format(new Double(origin));