Allow number_format to be internationalized. Props nbachiyski. fixes #3677

git-svn-id: http://svn.automattic.com/wordpress/trunk@5308 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
rob1n
2007-04-25 00:49:57 +00:00
parent 56add54053
commit d3f52c3b45
5 changed files with 28 additions and 8 deletions

View File

@@ -83,6 +83,14 @@ function date_i18n($dateformatstring, $unixtimestamp) {
return $j;
}
function number_format_i18n($number, $decimals = null) {
global $wp_locale;
// let the user override the precision only
$decimals = is_null($decimals)? $wp_locale->number_format['decimals'] : intval($decimals);
return number_format($number, $decimals, $wp_locale->number_format['decimal_point'], $wp_locale->number_format['thousands_sep']);
}
function get_weekstartend($mysqlstring, $start_of_week) {
$my = substr($mysqlstring,0,4);
$mm = substr($mysqlstring,8,2);