Double Methods
Use Primavera Cloud Expression Language supported methods to manipulate decimal numbers of the type double.
Refer to the official Java documentation for more information on each method.
Notes:
- Primavera Cloud Expression Language automatically converts Doubles to Int types when calling methods that require Int arguments.
- Types are indicated in bold in each method signature.
Double Methods
Method Signature | Description | Parameters | Example |
---|---|---|---|
| Returns the value of the Double calling the byteValue method represented as a byte. | No method parameters. |
|
| Compares the value of two Double arguments. Returns 0 if the arguments are equal, less than 0 if the first argument is less than the second, and greater than 0 if the first argument is greater than the second. | Double valueOne - First value to compare. Double valueTwo - Second value to compare. |
|
| Compares the value of the Double calling the compareTo method with a Double passed as an argument. Returns 0 if the argument is equal to the Double calling the method, less than 0 if the Double calling the method is less than the argument, and greater than 0 if the Double calling the method is greater than the argument. | Double value - Value to compare against the Double calling the method. |
|
| Returns a Double value matching the numeric value contained in the String passed as an argument. | String string - String to convert to a Double value. |
|
| Returns a String representing the Double value passed as an argument. | Double value - Double value to convert to a String. |
|
| Returns a Double value representing the value of a String or Double passed as an argument. | String string - String from which to extract a Double value. Double value - Double object form which to extract a Double value. |
|
Additional Double Methods
Method Signature | Description | Parameters | Examples |
---|---|---|---|
Double.doubleValue() | Returns the value of the Double calling this method. | No method parameters. | def x = 12.5; x.doubleValue(); //returns 12.5 |
Double.equals(Object obj) | Compares the double calling this method to the Object passed as an argument. Returns true if the argument is a Double value representing the same value as the Double calling the argument, otherwise returns false. | Object obj - An Object against which the Double calling the method is compared. | def x = 12.5; x.equals(12.5); //returns true x.equals(34.8); //returns false x.equals("Hello"); //returns false |
Double.floatValue() | Returns the float value of the Double calling this method. | No method parameters. | def x = 12.5; x.floatValue(); //returns 12.5 |
Double.hashCode() | Returns a hash code for the Double calling this method. | No method parameters. | def x = 12.5; x.hashCode(); //returns 1076428800 |
Double.intValue() | Returns the value of the Double calling this method as an Int type. | No method parameters. | def x = 12.5; x.intValue(); //returns 12 |
Double.isInfinite() | Returns true if the Double calling this method is infinitely large, otherwise returns false. | No method parameters. | def x = 12.5; x.isInfinite(); //returns false. |
Double.isNaN() | Returns true if the Double calling this method is not a number, otherwise returns false. | No method parameters. | def x = 12.5 x.isNaN(); //returns false |
Double.longValue() | Returns the value of the Double calling this method as a Long type. | No method parameters. | def x = 12.5; x.longValue(); //returns 12 |
Double.shortValue() | Returns the value of the Double calling this method as a Short type. | No method parameters. | def x = 12.5; x.shortValue(); //returns 12 |
Double.toHexString() | Returns the Double passed as an argument as a hexadecimal string. | Double value - Double to convert to a hexidecimal string. | Double.toHexString(12.5); //returns 0x1.9p3 |
Last Published Tuesday, May 21, 2024