Developing a multilingual application I'd like to output locale-correct numbers and dates. Testing on Win7 I'm failing with both:
setlocale(LC_ALL, 'de_DE@euro', 'de_DE', 'deu', 'de', 'ge', 'German_Germany.1251');
var_dump(localeconv());
Shows that the decimal character is . but should be , for German.
$f = 3.14;
echo($f);
Confirms 3.14 as output.
Regardless what I've tried for setting the locale I didn't have success. Similar results apply with number_format()
. It does however work for dates, e.g. month names.
What is the correct way to setlocale()
on Windows/ CLI?