ToDecimal (Any value)
Name | ToDecimal |
Syntax | ToDecimal (Any value) |
Purpose | To convert a value into a decimal. |
Description | Returns a decimal representing the specified value. Returns null if the value cannot be converted. |
Return Type | Decimal |
Parameters | value [System.Object] – Value to be converted |
![](https://documentation.astera.com/~gitbook/image?url=https%3A%2F%2Fgithub.com%2Fastera-software%2FAstera_Data_Stack_v9%2Fblob%2Fmain%2F.gitbook%2Fassets%2F0%2520%2820%29.png&width=768&dpr=4&quality=100&sign=cfc1e840&sv=1)
Example
In this example, we will pass a value with data type set to string, to the to the function transformation object using a Variables object.
Where,
value = 03.784000
![](https://documentation.astera.com/~gitbook/image?url=https%3A%2F%2Fgithub.com%2Fastera-software%2FAstera_Data_Stack_v9%2Fblob%2Fmain%2F.gitbook%2Fassets%2F1%2520%2821%29.png&width=768&dpr=4&quality=100&sign=95a16f60&sv=1)
Mapping the output value to a destination object shows that the data type has been converted to decimal, hence the conversion was successful.