note 26227 added to function.number-format

From: Date: Wed, 23 Oct 2002 13:03:46 +0000
Subject: note 26227 added to function.number-format
Groups: php.notes 
Request: Send a blank email to php-notes+get-38448@lists.php.net to get a copy of this message
I can't understand why number_format() doesn't honour locale. Oh well, here's an idea for a function you could use. function number_format_locale ($num, $decimals = null) { $locale = localeconv(); if(!isset($decimals)) $decimals = $locale['frac_digits']; return number_format($num, $decimals, $locale['decimal_point'], $locale['thousands_sep']); } -- http://www.php.net/manual/en/function.number-format.php http://master.php.net/manage/user-notes.php?action=edit+26227 http://master.php.net/manage/user-notes.php?action=delete+26227 http://master.php.net/manage/user-notes.php?action=reject+26227

« previous php.notes (#38448) next »