This function is used by Ignition's Expression language.

Description

Returns a hex formatted string representing the unsigned integer argument. If the argument is negative, the hex string represents the value plus 232.

Syntax

toHex(number)

  • Parameters

Integer number - The number to convert to hex.

  • Results

String - A string that is the hex value of the specified value.


The following feature is new in Ignition version 8.1.21
Click here to check out the other new features
toHex(color)

  • Parameters

Color color - An RGBA set to convert to hex.

  • Results

String - A string that is the hex value of the specified value.

Examples
Code Snippet
toHex(255) //Returns "FF".
Code Snippet
toHex(-255)  //Returns "FFFFFF01".
Code Snippet
toHex(color(192,26,68,241))   //Returns "C01A44F1"
  • No labels