LassoScript Utility
Basics Browse Detail

[Integer]

Tag Link [Integer] Category Math
Type Substitution Source Available No
Support Preferred Version 5.0
Change Unchanged Data Source Any
Output Type Integer Security None
Implementation LCAPI Sets Lasso 8.5, Lasso 8.0, Lasso 7.0, Lasso 6.0, Lasso 5.0

Description

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

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

Syntax

[Integer: 'Value']

[Variable: 'VariableName'=(Integer: 'Value')]

Parameters

Required Parameters
Value The value which will be converted to an integer.

Change Notes

When decimal values are cast to integer they are now rounded to the nearest integer, rather than being rounded to the next lowest integer.

Examples

To cast an action parameter to type integer:

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 integer 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: (Integer: (Action_Param: 'Price')) +
  (Integer: (Action_Param: 'Shipping'))]

20