[wp-trac] [WordPress Trac] #18460: admin css class 'branch-3-2' and locale 'fr_FR'
WordPress Trac
wp-trac at lists.automattic.com
Wed Aug 17 10:48:54 UTC 2011
#18460: admin css class 'branch-3-2' and locale 'fr_FR'
----------------------------+------------------
Reporter: olivM | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 3.3
Component: Administration | Version: 3.2
Severity: minor | Resolution:
Keywords: has-patch |
----------------------------+------------------
Comment (by dd32):
For anyone not aware of why; PHP when running in a locale-specific
environment (such as french) will cause some PHP functions to return
localised values, in the case of floatval(), it'll return '3,2' rather
than 3.2 as PHP uses the locale-specific decimal/thousands markers.
(float)'3.14' will also be 3,14, same as printf, same as every other
function you can think of. `echo intval(10234)` can also output as
'10,234' in certain locales.
An example of this in action: (Works on most Linux installs)
{{{
setlocale(LC_ALL, 'fr_FR');
var_dump( floatval( '3.2') ); //3,2
echo (float)'2' * (float)'1.1'; //2.2 - calculations work as expected as
PHP handles it internally, it's purely output which is affected
}}}
--
Ticket URL: <http://core.trac.wordpress.org/ticket/18460#comment:2>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list