[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Conversion of strings to numbers and numbers to strings.
- From: roberto@... (Roberto Ierusalimschy)
- Date: Tue, 30 May 2006 10:23:20 -0300
> I find that the reference manual for Lua 5.1 is disturbingly vague on
> the matter of converting numbers to strings and strings to numbers.
> Pretty much all it says is in section 2.2.1, string to number is done
> "following the usual conversion rules", and number to string is done
> "in a reasonable format".
We explicitly avoid too much restrictions here. If you want anything
specific when converting numbers to strings, you should use
string.format. If you want very specific syntax when converting strings
to numbers, use pattern matching.