#35889 [Opn->Bgs]: setlocale / Get money-field will remove the digits after the point/comma

From: Date: Wed, 04 Jan 2006 00:22:17 +0000
Subject: #35889 [Opn->Bgs]: setlocale / Get money-field will remove the digits after the point/comma
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-91426@lists.php.net to get a copy of this message
 ID:               35889
 Updated by:       sniper@php.net
 Reported By:      prohm at strato-rz dot de
-Status:           Open
+Status:           Bogus
 Bug Type:         Sybase-ct (ctlib) related
 Operating System: Linux
 PHP Version:      4.4.1
 New Comment:

Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system
is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.




Previous Comments:
------------------------------------------------------------------------

[2006-01-04 00:55:46] prohm at strato-rz dot de

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



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=35889&edit=1


Thread (2 messages)

« previous php.bugs (#91426) next »