ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
July 17th, 2024 | 10:00am-11:55am SGT (UTC+8) | Online

Wireshark-dev: Re: [Wireshark-dev] Lua converting a UINT64 to hex

From: Stig Bjørlykke <stig@xxxxxxxxxxxxx>
Date: Tue, 20 Nov 2012 11:08:29 +0100
On Mon, Nov 19, 2012 at 5:07 PM, Zadik, Maayan <mzadik@xxxxxxxxxxxxxxxx> wrote:
> Local s = string.format("%X", data.value)
>
> and get the following error:
> bad argument #2 to 'format' (number expected, got userdata)

Just try converting data.value with tostring first, like this:

local s = string.format("%X", tostring(data.value))


-- 
Stig Bjørlykke