FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » FILTER_SANITIZE_NUMBER_FLOAT non/sense
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: FILTER_SANITIZE_NUMBER_FLOAT non/sense [message #177019 is a reply to message #177017] Thu, 16 February 2012 13:22 Go to previous messageGo to previous message
Thomas Mlynarczyk is currently offline  Thomas Mlynarczyk
Messages: 131
Registered: September 2010
Karma:
Senior Member
Michael Fesser schrieb:

> It might be ridiculous, but why is it unusable? Just define the options
> you need.

Technically you are right. It is usable. Just as a toothbrush is usable
to clean the floor of a building. Possible, but awkward.

>> I wondered if there was some hidden secret - none so far.
>
> I could imagine one. The meaning of the separators in a float number
> depends on the locale. Here in Germany for example the meaning is
> reversed. So IMHO it makes sense to force the developer to think about
> this potential issue and explicitly define the behaviour of this filter.

Indeed, that could be a reason. But then it would have been better to
make the "option" mandatory: you *have* to specify some value, if not --
error. Then the programmer would be forced to deal with the issue. The
way it is now, however, it's just a source of confusion, frustration and
hours of debugging. (Sure, just RTFM, but who in their right mind would
expect FILTER_SANITIZE_NUMBER_FLOAT to swallow up decimal separators?)

On the other hand I seriously question the concept of a server side
locale in the context of the world wide web. If locale must be, then it
ought to be the client's locale.

Greetings,
Thomas

--
Ce n'est pas parce qu'ils sont nombreux à avoir tort qu'ils ont raison!
(Coluche)
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: How to start external PHP file from HTML?
Next Topic: DOMDocument HTML problem
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Mon Nov 25 01:44:00 GMT 2024

Total time taken to generate the page: 0.03785 seconds