Double Class

Contains methods for the Double primitive data type.

System

For more information on Double, see Double Data Type.

The following are methods for Double.

  • format()

    Returns the String value for this Double using the locale of the context user

  • intValue()

    Returns the Integer value of this Double by casting it to an Integer.

  • longValue()

    Returns the Long value of this Double.

  • round()

    Returns the closest Long to this Double value.

  • valueOf(stringToDouble)

    Returns a Double that contains the value of the specified String. As in Java, the String is interpreted as representing a signed decimal.

  • valueOf(fieldValue)

    Converts the specified object to a Double value. Use this method to convert a history tracking field value or an object that represents a Double value.

Returns the String value for this Double using the locale of the context user

public String format()

Type: String

Returns the Integer value of this Double by casting it to an Integer.

public Integer intValue()

Type: Integer

Returns the Long value of this Double.

public Long longValue()

Type: Long

Returns the closest Long to this Double value.

public Long round()

Type: Long

Returns a Double that contains the value of the specified String. As in Java, the String is interpreted as representing a signed decimal.

public static Double valueOf(String stringToDouble)

  • stringToDouble:

    Type: String

Type: Double

Converts the specified object to a Double value. Use this method to convert a history tracking field value or an object that represents a Double value.

public static Double valueOf(Object fieldValue)

  • fieldValue:

    Type: Object

Type: Double

Use this method with the OldValue or NewValue fields of history sObjects, such as AccountHistory, when the field type corresponds to a Double type, like a number field.