Re: FILTER_SANITIZE_NUMBER_FLOAT non/sense [message #177015 is a reply to message #177014] |
Thu, 16 February 2012 12:34 |
M. Strobel
Messages: 386 Registered: December 2011
Karma:
|
Senior Member |
|
|
Am 16.02.2012 12:53, schrieb Thomas Mlynarczyk:
> Michael Fesser schrieb:
>
>>>> $ php -r "echo filter_var('456,999', FILTER_SANITIZE_NUMBER_FLOAT,
>>>> FILTER_FLAG_ALLOW_THOUSAND);"
>>>> 456,999
>>> Hm, it is still messed up, in the default setup it eats points and commas.
>> Correct. [...]
>
> I consider this a very strange definition of "correct". The point (pun intended) of
> floats is precisely to be able to have a decimal point. It is absolutely ridiculous
> to filter that out by default. Do you have to explicitly allow "@" when filtering
> e-mail addresses?
>
--cut
> Greetings,
> Thomas
I read this as "correct, it is messed up".
So we seem to agree this is ridiculous and unusable.
I wondered if there was some hidden secret - none so far.
/Str.
|
|
|