How to covert int to hex type value and save it in a string?

@rextended, FWIW your num2hex function still comes in handy... While num2hex is super helpful, half the code is doing that one conversion :wink:: HOWTO: Import ZeroTier Members into Mikrotik DNS using $ZT2DNS

Since despite the new built-in ":convert", still cannot do "num2hex" and it just assumes strings, so you get ASCII codes for "1", "6" as hex:

:put [:convert from=raw to=hex 16]
3136

While Mikrotik in 7.15 did add a "byte-array" that go to/from hex, so if the ints are in an array type, [:convert] can help some cases:

:put [:convert from=byte-array to=hex {255;255}] 
# ffff

And so the "numbyte2hex" for the "one hex char" case can be reduced, in 7.15, to:

:global "numbyte2hex-using-convert" do={
    :return [:convert from=byte-array to=hex {$1}]
}

:put [$"numbyte2hex-using-convert" 255]
# ff

Not saying to replace your code — since you need 7.15 for the "byte-array". More FYI on the current state of these type conversions :wink: