Description:
------------
---
From manual page: http://www.php.net/filter.filters.sanitize
---
When setting the locale to fr_CA, using filter_var with decimal numbers is behaving irregularly since the comma is the decimal separator in fr_CA, the sanitized float becomes an int losing its comma.
filter_var is either not coded in a locale dependent way or this below scenario is not being caught in its handling of the locale.
Test script:
---------------
<?php
setlocale(LC_ALL, 'fr_CA.utf-8');
$number = 25 / 2;
$temp = filter_var($number, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION);
echo $temp;
?>
Expected result:
----------------
12,5
Actual result:
--------------
125