Virtuino Forum
DEC to HEX conversion - Printable Version

+- Virtuino Forum (https://virtuino.com/forum)
+-- Forum: Virtuino (https://virtuino.com/forum/forumdisplay.php?fid=1)
+--- Forum: Virtuino 6 (https://virtuino.com/forum/forumdisplay.php?fid=3)
+--- Thread: DEC to HEX conversion (/showthread.php?tid=1599)



DEC to HEX conversion - DF5EQ - 02-13-2024

Hi All,

is there a possibility to convert a DEC integer into a HEX string?

My use case is, to control a RGB lamp with the "RGB led and controler" widget.
The widget delivers the three color values as DEC integers, but my lamp likes to see a 6 digit HEX string (rrggbb).
Any ideas?

Cheers, Peter


RE: DEC to HEX conversion - DF5EQ - 02-18-2024

I elaborated a complex solution.
A simpler solution would be appreciated, but therefore a new function is needed: hex(X).
I tried to visualize both solutions in the attached file.