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

git-svn-id: https://develop.svn.wordpress.org/trunk@5308 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
rob1n
2007-04-25 00:49:57 +00:00
parent 2b3f6e3070
commit a40b296021
5 changed files with 28 additions and 8 deletions
+8
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);