Skip to main content
Version: 7.9

toBinary

This function is used by Ignition's Expression language.

Description

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

Syntax

toBinary(number)

  • Parameters

    • int number - The value to convert to binary.
  • Results

    • string - The string form of the binary representation of the specified number.

Examples

Code Snippet
toBinary(255) //returns "11111111"
Code Snippet
toBinary(-255) //returns "11111111111111111111111100000001"