Format pattern for binary and hex display values

Please add format patterns that will display integer values in binary or hex.

The number format patterns in Ignition are Java format patterns which don’t have a pattern for hex or binary display.

You could use Python to convert the integer to hex and display it as a string. The following will do that:myInt ="Random/RandomInteger1").value event.source.parent.getComponent('Label').text = hex(myInt)

If you need to do this in an expression, you should request a toHex() and toBinary() function that would take an int and return a string.


Please add toHex() and toBinary() expression functions that would take an int and return a hex or binary string respectively representing the integer value.

I should have looked before I typed. :slight_smile:

For 7.7, we’ve already implemented toHex() and fromHex() as expression functions. We expect that to be released sometime this quarter.

I’ll put a note in that you would like to have toBinary() as well.

Perfect. Thanks.

More new expression functions have been added to Ignition 7.7:

Hope this does everything you need.

Thanks! Those will be useful on occasion, saving some Python scripting.