[Decimal] casts a value to data type decimal. The following rules apply when performing this conversion.
It is not possible to use this method to cast values of types map or array.
Decimal('Value')
local(VariableName) = Decimal('Value')
Use the [decimal] type. Values retrieved from an HTML form or URL using [Action_Param] are always of data type string. It is necessary to cast these values to type decimal if they are to be used in a mathematical expression using symbols.
The following example adds the values for two [Action_Param] methods using the math symbol +, where the submitted values for Price and Shipping are '10' and '2.50', respectively.
Code
decimal(action_param('Price')) + decimal(action_param('Shipping'))
Result
12.500000
Please note that periodically LassoSoft will go through the notes and may incorporate information from them into the documentation. Any submission here gives LassoSoft a non-exclusive license and will be made available in various formats to the Lasso community.
©LassoSoft Inc 2015 | Web Development by Treefrog Inc | Privacy | Legal terms and Shipping | Contact LassoSoft
Recent Comments