Lasso Soft Inc. > Home

[ integer ]

Method

[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
  • Methods
  • Traits
Integer(Value)

local(result = integer(Value))
Has methods:
Examples
  • Beginner

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] methods using the math symbol +.

Code

integer(action_param('Price')) + integer(action_param('Shipping'))

Recent Comments

No Comments found

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 2013 | Web Development by Treefrog Interactive Inc | PrivacyLegal terms and Shipping | Contact LassoSoft