Re: [PHP4BETA] bug or feature ???
[email protected] (Andreas Pour)
| Newsgroups | php.version4 |
|---|---|
| Message-ID | <[email protected]> |
[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