### CDbl

Basic and Crystal syntax.

CDbl and ToNumber (numeric), ToNumber (string) are equivalent functions.

##### Overloads

- CDbl (number or currency)
- CDbl (string)

##### Arguments

CDbl (number or currency) | number or currency is a Number or Currency value or expression.
CDbl (string) | string is a String value or expression.

##### Returns

Number value

##### Action

CDbl returns a Number value created by converting the given Number, Currency or String type argument to a Number value. If the conversion cannot be done, an error occurs.

##### Examples

The following examples are applicable to both Basic and Crystal syntax:

`CDbl ({Orders.Order Amount})`

Returns the value of the Currency field {Orders.Order Amount} converted to Number type.

`CDbl ("$120.20")`

Returns the Number value of 120.2.

##### Comments

- This function is designed to work like the Visual Basic function of the same name.

You can use the IsNumeric (str) or NumericText (str) function to check if the String argument can be converted to a Currency before doing the actual conversion. That way, if the conversion cannot be done, you can handle the situation appropriately.

Seagate Software, Inc. http://www.seagatesoftware.com Please send comments to: techpubs@seagatesoftware.com