Ticket #3677: number-format-i18n.diff
File number-format-i18n.diff, 1.7 KB (added by , 18 years ago) |
---|
-
wp-includes/functions.php
80 80 return $j; 81 81 } 82 82 83 function number_format_i18n($number, $decimals = null) { 84 global $wp_locale; 85 // let the user override the precision only 86 $decimals = is_null($decimals)? $wp_locale->number_format['decimals'] : intval($decimals); 87 88 return number_format($number, $decimals, $wp_locale->number_format['decimal_point'], $wp_locale->number_format['thousands_sep']); 89 } 90 83 91 function get_weekstartend($mysqlstring, $start_of_week) { 84 92 $my = substr($mysqlstring,0,4); 85 93 $mm = substr($mysqlstring,8,2); -
wp-includes/locale.php
87 87 $this->meridiem['AM'] = __('AM'); 88 88 $this->meridiem['PM'] = __('PM'); 89 89 90 // Numbers formatting 91 // See http://php.net/number_format 92 93 $trans = __('number_format_decimals'); 94 $this->number_format['decimals'] = ('number_format_decimals' == $trans) ? 0 : $trans; 95 96 $trans = __('number_format_decimal_point'); 97 $this->number_format['decimal_point'] = ('number_format_decimal_point' == $trans) ? '.' : $trans; 98 99 $trans = __('number_format_thousands_sep'); 100 $this->number_format['thousands_sep'] = ('number_format_thousands_sep' == $trans) ? ',' : $trans; 101 90 102 // Import global locale vars set during inclusion of $locale.php. 91 103 foreach ( $this->locale_vars as $var ) { 92 104 if ( isset($GLOBALS[$var]) ) … … 138 150 } 139 151 } 140 152 141 ?> 142 No newline at end of file 153 ?>