TODOUBLE

[Version: 2024 - September]
[Build: 24.09.03003] 

Converts an integer string or a decimal string to a double data type.

(string doubleString)
Returns double value based on passed value.
Example: ToDouble("22.2") returns a double value (22.2).
doubleString: Required. The value of the double.

 

(string doubleStringstring cultureCode)
Returns double value based on passed value and culture parameters.
Example: ToDouble("22,2", "da-DK") and ToDouble("22.2", "en-US") return a double value (22.2).
doubleString: Required. The value of the double.

 

(string doubleStringstring cultureCodebool isSafeCastfloat defaultValue)
Returns double value based on passed value.
Example: ToDouble("INVALID", "da-DK", true, -1) fails with conversion error and returns a passed default value (-1).
doubleString: Required. The value of the double.

 

(string doubleStringstring cultureCodebool isSafeCastfloat defaultValue)
Returns double value based on passed value and culture parameters.
Example: ToDouble("INVALID", "da-DK", true, -1) fails with conversion error and returns a passed default value (-1).
doubleString: Required. The value of the double.

 

Examples

The two DoubleString values are formatted as strings in Excel ('1234.5678 and '8765.4321):

When one of the strings cannot be converted to an double:

Using the 'isSafeCast = true' option to convert data despite incorrect format:

 

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.