From:             
Operating system: N/A
PHP version:      5.2.13
Package:          Unknown/Other Function
Bug Type:         Feature/Change Request
Bug description:php_filter_float does not allow custom thousand separators

Description:
------------
The php_filter_float function located in
/[svn]/php/php-src/trunk/ext/filter/logical_filters.c does not allow
setting custom thousand separators - the function always uses built-in set
of three separators provided in the tsd_sep[3] local variable, currently
",.'" (without double quotes).



As a result, the function is not usable in countries which uses other char
as a thousand separator, for example " ". Additionally, it does not allow
to prohibit separators some of the separators.



Please add support for setting custom thousand separators which will
override the one built-in in the source code.

Test script:
---------------
var_dump(filter_var('1 000', FILTER_VALIDATE_FLOAT, array('flags' =>
FILTER_FLAG_ALLOW_THOUSAND, 'options' => array('thousand' => ' '))));

Expected result:
----------------
float(1000)

Actual result:
--------------
bool(false)

-- 
Edit bug report at http://bugs.php.net/bug.php?id=51368&edit=1
-- 
Try a snapshot (PHP 5.2):            
http://bugs.php.net/fix.php?id=51368&r=trysnapshot52
Try a snapshot (PHP 5.3):            
http://bugs.php.net/fix.php?id=51368&r=trysnapshot53
Try a snapshot (PHP 6.0):            
http://bugs.php.net/fix.php?id=51368&r=trysnapshot60
Fixed in SVN:                        
http://bugs.php.net/fix.php?id=51368&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=51368&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=51368&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=51368&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=51368&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=51368&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=51368&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=51368&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=51368&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=51368&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=51368&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=51368&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=51368&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=51368&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=51368&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=51368&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=51368&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=51368&r=mysqlcfg

Reply via email to