[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Converting dec to hex issues
- From: Marcin Jurczuk <mjurczuk@...>
- Date: Thu, 18 Nov 2010 22:22:19 +0100
On 18 November 2010 19:04, Drake Wilson <drake@begriffli.ch> wrote:
> Quoth Marcin Jurczuk <mjurczuk@gmail.com>, on 2010-11-18 18:44:54 +0100:
>> > print("Original value: " .. os.time() .. " Decimal base conversion: " .. tonumber(os.time(),10) .. " Hex version: " .. tonumber(os.time(),16))
>
> That's backwards. You're saying "convert this result, first converted
> implicitly into a string, into a number as though the digits were base
> 16", so you're asking for the numeric value of 0x1290102177.
>
> You probably want string.format('%x', os.time()).
>
Of course you are right :)
Thanks
--
Marcin,