Display HEX on ViewOn

I have a value coming across my flexy in decimal. Is there a way to convert that to display in HEX?

I am using one of preloaded KPI Cell Symbols to display this value and assigned the “value” to “N1_Fault_Code” (which is an integer tag in my flexy). I am assuming I need to use a BASIC Script, but don’t know what the syntax would be or how I would type that out.

Capture

Thanks!

Here’s a Javascript example I made that should do this, it’s triggered when you push the rectangle and will convert the value from a decimal to a hex value. It was done with an Ewon tag called test, and it’s writing to the text object with a unit id seen in the first picture below

var dec_to_hex = getEwonTagVal(‘test’);
hexString = dec_to_hex.toString(16);

document.getElementById(“UID_1617980782184”).innerHTML = hexString;