Changeset 14184
- Timestamp:
- 04/21/2010 09:41:20 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/admin-header.php
r14163 r14184 44 44 typenow = '<?php if ( isset($current_screen->post_type) ) echo $current_screen->post_type; ?>', 45 45 adminpage = '<?php echo $admin_body_class; ?>', 46 thousandsSeparator = '<?php echo addslashes( $wp_locale->number_format['thousands_sep'] ); ?>', 47 decimalPoint = '<?php echo addslashes( $wp_locale->number_format['decimal_point'] ); ?>'; 46 thousandsSeparator = '<?php echo addslashes( $wp_locale->number_format['thousands_sep'] ); ?>'; 48 47 //]]> 49 48 </script> -
trunk/wp-includes/functions.php
r14116 r14184 127 127 128 128 /** 129 * Convert number to format based on the locale.129 * Convert integer number to format based on the locale. 130 130 * 131 131 * @since 2.3.0 132 132 * 133 * @param mixed$number The number to convert based on locale.134 * @param int $decimals Precision of the number of decimal places. 133 * @param int $number The number to convert based on locale. 134 * @param int $decimals Precision of the number of decimal places. Deprectated. 135 135 * @return string Converted number in string format. 136 136 */ 137 137 function number_format_i18n( $number, $decimals = null ) { 138 138 global $wp_locale; 139 // let the user override the precision only 140 $decimals = ( is_null( $decimals ) ) ? $wp_locale->number_format['decimals'] : intval( $decimals ); 141 142 $num = number_format( $number, $decimals, $wp_locale->number_format['decimal_point'], $wp_locale->number_format['thousands_sep'] ); 143 144 // let the user translate digits from latin to localized language 145 return apply_filters( 'number_format_i18n', $num ); 139 $number = (int)$number; 140 if ( !is_null( $decimals ) ) _deprecated_argument( __FUNCTION__, '3.0' ); 141 $formatted = number_format( $number, 0, null, $wp_locale->number_format['thousands_sep'] ); 142 return apply_filters( 'number_format_i18n', $formatted ); 146 143 } 147 144 … … 164 161 * 165 162 * @param int|string $bytes Number of bytes. Note max integer size for integers. 166 * @param int $decimals Precision of number of decimal places. 163 * @param int $decimals Precision of number of decimal places. Deprecated. 167 164 * @return bool|string False on failure. Number string on success. 168 165 */ … … 176 173 'B ' => 1, // pow( 1024, 0) 177 174 ); 178 175 if ( !is_null( $decimals ) ) _deprecated_argument( __FUNCTION__, '3.0' ); 179 176 foreach ( $quant as $unit => $mag ) 180 177 if ( doubleval($bytes) >= $mag ) 181 return number_format_i18n( $bytes / $mag, $decimals) . ' ' . $unit;178 return number_format_i18n( round( $bytes / $mag ) ) . ' ' . $unit; 182 179 183 180 return false; -
trunk/wp-includes/load.php
r14181 r14184 220 220 $timeend = $mtime[1] + $mtime[0]; 221 221 $timetotal = $timeend - $timestart; 222 $r = ( function_exists( 'number_format_i18n' ) ) ? number_format_i18n( $timetotal, $precision ) :number_format( $timetotal, $precision );222 $r = number_format( $timetotal, $precision ); 223 223 if ( $display ) 224 224 echo $r; -
trunk/wp-includes/locale.php
r12859 r14184 179 179 // See http://php.net/number_format 180 180 181 /* translators: $decimals argument for http://php.net/number_format, default is 0 */182 $trans = __('number_format_decimals');183 $this->number_format['decimals'] = ('number_format_decimals' == $trans) ? 0 : $trans;184 185 /* translators: $dec_point argument for http://php.net/number_format, default is . */186 $trans = __('number_format_decimal_point');187 $this->number_format['decimal_point'] = ('number_format_decimal_point' == $trans) ? '.' : $trans;188 189 181 /* translators: $thousands_sep argument for http://php.net/number_format, default is , */ 190 182 $trans = __('number_format_thousands_sep');
Note: See TracChangeset
for help on using the changeset viewer.