Re: [fw-general] NumberFormat filter always returns a string?

2013-05-17 Thread Andreas Möller
Hello Marco,


I've opened an issue, here it is

* https://github.com/zendframework/zf2/issues/4493


Best regards,

Andreas

-- 
List: fw-general@lists.zend.com
Info: http://framework.zend.com/archives
Unsubscribe: fw-general-unsubscr...@lists.zend.com




[fw-general] NumberFormat filter always returns a string?

2013-05-16 Thread Andreas Möller
Is it just me, or does the NumberFormat filter almost always return a string, 
even if a string was passed to it that could successfully parsed?


Best regards,

Andreas
--
List: fw-general@lists.zend.com
Info: http://framework.zend.com/archives
Unsubscribe: fw-general-unsubscr...@lists.zend.com




Re: [fw-general] NumberFormat filter always returns a string?

2013-05-16 Thread Marco Pivetta
Did you already check
https://github.com/zendframework/zf2/blob/master/tests/ZendTest/I18n/Filter/NumberFormatTest.php?

Marco Pivetta

http://twitter.com/Ocramius

http://ocramius.github.com/


On 16 May 2013 18:51, Andreas Möller a...@localheinz.com wrote:

 Is it just me, or does the NumberFormat filter almost always return a
 string, even if a string was passed to it that could successfully parsed?


 Best regards,

 Andreas
 --
 List: fw-general@lists.zend.com
 Info: http://framework.zend.com/archives
 Unsubscribe: fw-general-unsubscr...@lists.zend.com





Re: [fw-general] NumberFormat filter always returns a string?

2013-05-16 Thread Andreas Möller

 Did you already check 
 https://github.com/zendframework/zf2/blob/master/tests/ZendTest/I18n/Filter/NumberFormatTest.php
  ?

That's where I looked in the first place and figured from the second test and 
the data provider, that when a parseable string is passed, a float should be 
returned. 

Since I haven't gotten around to running the tests for only the filter 
components, I mimicked the test by using the data from the provider and the 
code from the test and var_dump'ing the raw and filtered data. I'm getting 
strings returned. 

Unless parsing failed and the raw value is returned, everything is returned as 
a string from filter() as str_replace() is run on the result. 


Best regards,

Andreas


Re: [fw-general] NumberFormat filter always returns a string?

2013-05-16 Thread Andreas Möller
return str_replace(\xC2\xA0, ' ', $result);

Always returns a string.