[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Floats and %d
- From: Dirk Laurie <dirk.laurie@...>
- Date: Tue, 21 Jul 2015 03:59:02 +0200
2015-07-20 23:14 GMT+02:00 Parke <parke.nexus@gmail.com>:
>> string.format("%d", 2.7)
>
> In this case, string.format does not have to convert 2.7 to an integer
> (although it could). string.format in this case is converting a float
> to a string, and the request for truncation is not hidden, it is
> explicit in %d.
This is a persuasive argument. However, the manual says:
Options c, d, i, o, u, X, and x expect an integer.
Should the argument apply to the others too? Maybe %i?
Maybe not %x?