[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: A 5.3 change is biting us hard...
- From: Hisham <h@...>
- Date: Wed, 10 Feb 2016 14:57:56 -0200
On 10 February 2016 at 14:50, Coda Highland <chighland@gmail.com> wrote:
>
> On Feb 10, 2016 8:46 AM, "Daniel Silverstone" <dsilvers@digital-scurf.org>
> wrote:
>>
>> On Wed, Feb 10, 2016 at 17:26:24 +0100, Marc Balmer wrote:
>> > We switched from Lua 5.2 to Lua 5.3 and suddenly a seemingly small
>> > change in Lua's number formatting is hitting us really hard:
>> >
>> > Before 5.2, a number value of 41.0 would produce a string of '41'.
>> > After 5.3, it produces '41.0':
>>
>> Time to start using string.format("%u", ...) ?
>
> That only works if you know the value is an integer. If it's not, then
> you're losing data. There operation you want is probably more like s/\.0$//
> than %u.
I'd venture to guess that if one is having trouble due to ".0", that
almost certainly means they are indeed expecting an integer.
-- Hisham