|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-01-04 01:22 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 08:00:01 2025 UTC |
Description: ------------ When I set the locale to de_DE@euro at the start of the script and read a money-value from the database, he remove all after the point, because after the setlocal he match at a comma, but the database reply ever an point. I I make the setlocal(LC_ALL,"de_DE@euro") after the sybase_query, it work fine. Reproduce code: --------------- setlocale(LC_NUMERIC,"de_DE@euro"); print "<pre>\n"; $conn = sybase_connect(XXX,XXX,XXX"); $sql = " select kosten from artikel"; $result=sybase_query($sql,$conn); while (list($kosten) = sybase_fetch_row($result)) { echo sprintf("%.2f",$kosten)."\n"; } print "</pre>\n"; Expected result: ---------------- 0,00 0,00 0,69 0,99 0,99 0,99 0,99 0,99 1,99 5,99 5,99 Actual result: -------------- 0,00 0,00 0,00 0,00 0,00 0,00 0,00 0,00 1,00 5,00 5,00