php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #35889 setlocale / Get money-field will remove the digits after the point/comma
Submitted: 2006-01-04 00:55 UTC Modified: 2006-01-04 01:22 UTC
From: prohm at strato-rz dot de Assigned:
Status: Not a bug Package: Sybase-ct (ctlib) related
PHP Version: 4.4.1 OS: Linux
Private report: No CVE-ID: None
 [2006-01-04 00:55 UTC] 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


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-01-04 01:22 UTC] sniper@php.net
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.


 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Thu Feb 20 08:01:24 2020 UTC