User Manual

GETTING STARTED


MODULES AND PLATFORM


APPENDIX


TUTORIALS & HELPFUL TRICKS


STRATEGIC PARTNER LINKS

Sepasoft - MES Modules
Cirrus Link - MQTT Modules

RESOURCES

Inductive University
Ignition Demo Project
Knowledge Base Articles
Forum
IA Support
SDK Documentation
SDK Examples

ALL USER MANUAL VERSIONS

Ignition 8.1
Ignition 7.9
Ignition 7.8

Deprecated Pages

Employees

Sign In

Skip to end of metadata
Go to start of metadata

This function is used by Ignition's Expression language.

Description

Tries to coerce value into an integer (32-bit integer). If value is a number, the conversion is direct (with possible loss of precision). If value is a string, it is parsed to see if it represents an integer. If not, type casting fails. Will round if appropriate.

Syntax

toInt(value[, failover])

  • Parameters

object value - The value to type cast.

object failover - Optional. The failover value if type casting fails.

  • Results

int - The value type cast as an int.

Examples
Code Snippet
toInt("38") //returns 38
Code Snippet
toInt("33.9") // returns 34
Code Snippet
toInt({Root Container.Text Field.text}, -1) //returns the value in the text box as an int, or -1 if the value doesn't represent an number.
  • No labels