mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-10-06 23:58:03 +00:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user