<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[14184] trunk:
  Remove unnecessary translations of decimal point character and number of decimal places
 .</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/14184">14184</a></dd>
<dt>Author</dt> <dd>westi</dd>
<dt>Date</dt> <dd>2010-04-21 21:41:20 +0000 (Wed, 21 Apr 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>Remove unnecessary translations of decimal point character and number of decimal places. Fixes <a href="http://trac.wordpress.org/ticket/10555">#10555</a> props nbachiyski.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminadminheaderphp">trunk/wp-admin/admin-header.php</a></li>
<li><a href="#trunkwpincludesfunctionsphp">trunk/wp-includes/functions.php</a></li>
<li><a href="#trunkwpincludesloadphp">trunk/wp-includes/load.php</a></li>
<li><a href="#trunkwpincludeslocalephp">trunk/wp-includes/locale.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminadminheaderphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/admin-header.php (14183 => 14184)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/admin-header.php        2010-04-21 21:35:39 UTC (rev 14183)
+++ trunk/wp-admin/admin-header.php        2010-04-21 21:41:20 UTC (rev 14184)
</span><span class="lines">@@ -43,8 +43,7 @@
</span><span class="cx">         pagenow = '&lt;?php echo $current_screen-&gt;id; ?&gt;',
</span><span class="cx">         typenow = '&lt;?php if ( isset($current_screen-&gt;post_type) ) echo $current_screen-&gt;post_type; ?&gt;',
</span><span class="cx">         adminpage = '&lt;?php echo $admin_body_class; ?&gt;',
</span><del>-        thousandsSeparator = '&lt;?php echo addslashes( $wp_locale-&gt;number_format['thousands_sep'] ); ?&gt;',
-        decimalPoint = '&lt;?php echo addslashes( $wp_locale-&gt;number_format['decimal_point'] ); ?&gt;';
</del><ins>+        thousandsSeparator = '&lt;?php echo addslashes( $wp_locale-&gt;number_format['thousands_sep'] ); ?&gt;';
</ins><span class="cx"> //]]&gt;
</span><span class="cx"> &lt;/script&gt;
</span><span class="cx"> &lt;?php
</span></span></pre></div>
<a id="trunkwpincludesfunctionsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/functions.php (14183 => 14184)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/functions.php        2010-04-21 21:35:39 UTC (rev 14183)
+++ trunk/wp-includes/functions.php        2010-04-21 21:41:20 UTC (rev 14184)
</span><span class="lines">@@ -126,23 +126,20 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /**
</span><del>- * Convert number to format based on the locale.
</del><ins>+ * Convert integer number to format based on the locale.
</ins><span class="cx">  *
</span><span class="cx">  * @since 2.3.0
</span><span class="cx">  *
</span><del>- * @param mixed $number The number to convert based on locale.
- * @param int $decimals Precision of the number of decimal places.
</del><ins>+ * @param int $number The number to convert based on locale.
+ * @param int $decimals Precision of the number of decimal places. Deprectated.
</ins><span class="cx">  * @return string Converted number in string format.
</span><span class="cx">  */
</span><span class="cx"> function number_format_i18n( $number, $decimals = null ) {
</span><span class="cx">         global $wp_locale;
</span><del>-        // let the user override the precision only
-        $decimals = ( is_null( $decimals ) ) ? $wp_locale-&gt;number_format['decimals'] : intval( $decimals );
-
-        $num = number_format( $number, $decimals, $wp_locale-&gt;number_format['decimal_point'], $wp_locale-&gt;number_format['thousands_sep'] );
-
-        // let the user translate digits from latin to localized language
-        return apply_filters( 'number_format_i18n', $num );
</del><ins>+        $number = (int)$number;
+        if ( !is_null( $decimals ) ) _deprecated_argument( __FUNCTION__, '3.0' );
+        $formatted = number_format( $number, 0, null, $wp_locale-&gt;number_format['thousands_sep'] );
+        return apply_filters( 'number_format_i18n', $formatted );
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /**
</span><span class="lines">@@ -163,7 +160,7 @@
</span><span class="cx">  * @since 2.3.0
</span><span class="cx">  *
</span><span class="cx">  * @param int|string $bytes Number of bytes. Note max integer size for integers.
</span><del>- * @param int $decimals Precision of number of decimal places.
</del><ins>+ * @param int $decimals Precision of number of decimal places. Deprecated.
</ins><span class="cx">  * @return bool|string False on failure. Number string on success.
</span><span class="cx">  */
</span><span class="cx"> function size_format( $bytes, $decimals = null ) {
</span><span class="lines">@@ -175,10 +172,10 @@
</span><span class="cx">                 'kB' =&gt; 1024,           // pow( 1024, 1)
</span><span class="cx">                 'B ' =&gt; 1,              // pow( 1024, 0)
</span><span class="cx">         );
</span><del>-
</del><ins>+        if ( !is_null( $decimals ) ) _deprecated_argument( __FUNCTION__, '3.0' );
</ins><span class="cx">         foreach ( $quant as $unit =&gt; $mag )
</span><span class="cx">                 if ( doubleval($bytes) &gt;= $mag )
</span><del>-                        return number_format_i18n( $bytes / $mag, $decimals ) . ' ' . $unit;
</del><ins>+                        return number_format_i18n( round( $bytes / $mag ) ) . ' ' . $unit;
</ins><span class="cx"> 
</span><span class="cx">         return false;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkwpincludesloadphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/load.php (14183 => 14184)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/load.php        2010-04-21 21:35:39 UTC (rev 14183)
+++ trunk/wp-includes/load.php        2010-04-21 21:41:20 UTC (rev 14184)
</span><span class="lines">@@ -219,7 +219,7 @@
</span><span class="cx">         $mtime = explode( ' ', $mtime );
</span><span class="cx">         $timeend = $mtime[1] + $mtime[0];
</span><span class="cx">         $timetotal = $timeend - $timestart;
</span><del>-        $r = ( function_exists( 'number_format_i18n' ) ) ? number_format_i18n( $timetotal, $precision ) : number_format( $timetotal, $precision );
</del><ins>+        $r = number_format( $timetotal, $precision );
</ins><span class="cx">         if ( $display )
</span><span class="cx">                 echo $r;
</span><span class="cx">         return $r;
</span></span></pre></div>
<a id="trunkwpincludeslocalephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/locale.php (14183 => 14184)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/locale.php        2010-04-21 21:35:39 UTC (rev 14183)
+++ trunk/wp-includes/locale.php        2010-04-21 21:41:20 UTC (rev 14184)
</span><span class="lines">@@ -178,14 +178,6 @@
</span><span class="cx">                 // Numbers formatting
</span><span class="cx">                 // See http://php.net/number_format
</span><span class="cx"> 
</span><del>-                /* translators: $decimals argument for http://php.net/number_format, default is 0 */
-                $trans = __('number_format_decimals');
-                $this-&gt;number_format['decimals'] = ('number_format_decimals' == $trans) ? 0 : $trans;
-
-                /* translators: $dec_point argument for http://php.net/number_format, default is . */
-                $trans = __('number_format_decimal_point');
-                $this-&gt;number_format['decimal_point'] = ('number_format_decimal_point' == $trans) ? '.' : $trans;
-
</del><span class="cx">                 /* translators: $thousands_sep argument for http://php.net/number_format, default is , */
</span><span class="cx">                 $trans = __('number_format_thousands_sep');
</span><span class="cx">                 $this-&gt;number_format['thousands_sep'] = ('number_format_thousands_sep' == $trans) ? ',' : $trans;
</span></span></pre>
</div>
</div>

</body>
</html>