Here you can find the source of doubleToString(final Double value)
Parameter | Description |
---|---|
value | A Double to convert to a String |
public static String doubleToString(final Double value)
//package com.java2s; // Licensed under the MIT license. See License.txt in the repository root. public class Main { /**/*from ww w . j a va 2s .com*/ * For Visual Studio compatibility: converts a Double-type to a String, but * ensures that whole numbers have no decimal point. * * This is for rule engine parsing and display. Ie, when we have a double * value "0", we display it as "0.0", while .NET (and C# in general) * displays "0". This leads to interop headaches, particularly with * ALLOWEDVALUES fields. * * @param value * A Double to convert to a String * @return A String representation of a Double */ public static String doubleToString(final Double value) { if (value == null) { return null; } if (value.intValue() == value.doubleValue()) { return Integer.toString(value.intValue()); } return value.toString(); } }