- 16 Apr 2024
- 1 Minute to read
- DarkLight
ConvertToNumber
- Updated on 16 Apr 2024
- 1 Minute to read
- DarkLight
General
The ConvertToNumber function can be used to convert a value to a Number.
If the value cannot be converted to a number (e.g. when trying to convert the String "This is a text" to a number), the execution of the report document preview or task will fail.
Syntax
The syntax of the ConvertToNumber function is:
ConvertToNumber(<value>)
Examples
The following Expression returns the value of the variable vTest of Datasource MyDatasource as Number:
ConvertToNumber([Datasource].[MyDatasources].[Variable].[vTest])
If the variable contains a String with value "123" then the returned number will be 123.