[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: string.format("%f", ...) receiving string argument
- From: Daniel Bolgheroni <daniel@...>
- Date: Thu, 28 Mar 2013 10:03:43 -0300
Hi lua-l@,
I have this:
x = tostring(math.huge)
print(string.format("%f", x))
Reference manuals for both 5.1 and 5.2 say that option f expects a number.
However, 5.1 prints 'inf' and 5.2 breaks with:
stdin:1: bad argument #2 to 'format' (number expected, got string)
stack traceback:
[C]: in function 'format'
stdin:1: in main chunk
[C]: in ?
If I use something like x="foo", both break.
Is this expected?
Thank you.