Re: [PHP4BETA] bug or feature ???
[email protected] (Andi Gutmans)
| Newsgroups | php.version4 |
|---|---|
| Message-ID | <[email protected]> |
It should not be locale specific. As it is PHP won't accept any doubles in the script other than doubles in the format of 49.445. The question is how to treat strings which don't originate in the source file if they should be converted with locale or not. I think not. Andi On Mon, 22 May 2000, Andreas Pour wrote: > [email protected] wrote: > > [ ... ] > > > > but if windows locale scheme is broken, > > > IMHO it's a bit beyond PHP to fix it. > > > > what about to force php4 to use '.' > > as decimal point ? > > i can't imagine how to write locales > > independent scripts that uses floating > > point numbers... > > One possible solution is to provide a flag to indicate whether to use > locale-dependent conversion or not. I don't see how one can make > correct assumptions about a number like "3.000,14". That may be a > correct floating point number or it could be garbage. > > The (problem?) with the Internet is it's international. The fact that > my website is in US or Germany doesn't affect the types of values users > may enter; they may not even know my locale. So I guess I'm not sure > why one would look to a locale-dependent interpretation of numbers (as > far as programmers go, I think the great majority learned to program > using the US-style number system, and hence making number interpreation > locale-sensitive makes even less sense). > > Isn't there an intelligent conversion function that looks for commas and > periods and tries to make sense of it? I guess no matter what something > like 3,001 will be ambiguous, but 3,001.1 or 1.300,1 are not. > > Ciao, > > Andreas > >