php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #16532 locale information (LC_NUMERIC) not used in bcmath functions
Submitted: 2002-04-10 11:53 UTC Modified: 2002-07-23 14:13 UTC
From: anze at volja dot net Assigned:
Status: Not a bug Package: BC math related
PHP Version: 4.1.0 OS: Linux
Private report: No CVE-ID: None
 [2002-04-10 11:53 UTC] anze at volja dot net
Summary says it all...

Some could argue it is a missing feature, not a bug, but 
it would make a life a bit easier for non-english 
developers, especially as this library is ofteh used for 
monetary stuff...

<?php

// first setlocale():
if (
    (FALSE===setlocale("LC_ALL","sl_SI"))&&
    (FALSE===setlocale("LC_ALL","slovenian"))&&
    (FALSE===setlocale("LC_ALL","slovene"))&&
    (FALSE===setlocale("LC_ALL","slovenski"))&&
    (FALSE===setlocale("LC_ALL","sl"))
   )
  echo "SETLOCALE() ERROR!!!<br>\n";

// this line outputs "0.00" instead of "0,80":
echo bcadd("0,3","0,5",2);

?>

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-07-23 14:13 UTC] hholzgra@php.net
locale settings should not affect the way code is parsed 
(it still does in some places of Zend Engine, but that is a different story)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 06:01:30 2024 UTC