Lasso Soft Inc. > Home

[Decimal]

[Decimal] casts a value to data type decimal. The following rules apply when performing this conversion.
- Integer values are cast to their decimal equivalent.
- String values that contain only a decimal or integer representation are cast to the decimal equivalent.
- Null values are cast to 0.

It is not possible to use this tag to cast values of types map or array.

  • Syntax
  • Parameters
[Decimal: 'Value']

[Variable: 'VariableName'=(Decimal: 'Value')]
Required Parameters
Value The value will be converted to a decimal and returned.
Examples

To cast an action parameter to type decimal:

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 decimal if they will be used in a mathematical expression using symbols.

The following example adds the values for two [Action_Param] tags using the math symbol +.

[Output: (Decimal: (Action_Param: 'Price')) +
  (Decimal: (Action_Param: 'Shipping'))]
Result:
19.95
Tag Link [Decimal] Category Math
Type Substitution Data Source Any
Support Preferred Version 5.0
Output Type Decimal Security None
Implementation LCAPI Sets Lasso 7.0, Lasso 6.0, Lasso 5.0

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. > Home

 

 

©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft