lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 8/23/05, Walter Cruz <walter.php@gmail.com> wrote:
> well, after I send the e-mail, I thinked that I can use the string
> library and just strip the chars after the dot, right ?

You can, but:
a) It's probably slower, if you care about that;
b) In some locales, it'll be a comma instead of a period;
c) It may not have the negative-number behavior that you want; and
d) It'll have weird effects if the number is in exponential notation
(in particular, an uninitialized float will be converted into a very
reasonable-looking integer).

Ben