Fix mixed tabs and spaces from r97793
authorSam Reed <reedy@users.mediawiki.org>
Thu, 22 Sep 2011 11:06:48 +0000 (11:06 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Thu, 22 Sep 2011 11:06:48 +0000 (11:06 +0000)
Couple of minor style tweaks also

languages/Language.php

index 75f3288..522c44b 100644 (file)
@@ -2612,12 +2612,11 @@ class Language {
         */
        function commafy( $_ ) {
                $digitGroupingPattern = $this->digitGroupingPattern();
-               
+
                if ( !$digitGroupingPattern || $digitGroupingPattern === "###,###,###" ) {
                        //default grouping is at thousands,  use the same for ###,###,### pattern too.
                        return strrev( (string)preg_replace( '/(\d{3})(?=\d)(?!\d*\.)/', '$1,', strrev( $_ ) ) );
-               }
-               else {
+               } else {
                        // Ref: http://cldr.unicode.org/translation/number-patterns
                        $numberpart = array();
                        $decimalpart = array();
@@ -2625,28 +2624,27 @@ class Language {
                        preg_match( "/\d+/", $_, $numberpart );
                        preg_match( "/\.\d*/", $_, $decimalpart );
                        $groupedNumber = ( count( $decimalpart ) > 0 ) ? $decimalpart[0]:"";
-                       if ( $groupedNumber  === $_){
-                           //the string does not have any number part. Eg: .12345
-                           return $groupedNumber;
+                       if ( $groupedNumber  === $_ ){
+                               //the string does not have any number part. Eg: .12345
+                               return $groupedNumber;
                        }
                        $start = $end = strlen( $numberpart[0] );
-                       while ( $start > 0 )
-                       {
-                           $match = $matches[0][$numMatches -1] ;
-                           $matchLen = strlen( $match );
-                           $start = $end - $matchLen;
-                           if ( $start < 0 ) {
-                               $start = 0;
-                           }
-                           $groupedNumber = substr( $_ , $start, $end -$start ) . $groupedNumber ;
-                           $end = $start;
-                           if ( $numMatches > 1 ) {
-                               // use the last pattern for the rest of the number
-                               $numMatches--;
-                           }
-                           if ( $start > 0 ) {
-                               $groupedNumber = "," . $groupedNumber;
-                           }
+                       while ( $start > 0 ) {
+                               $match = $matches[0][$numMatches -1] ;
+                               $matchLen = strlen( $match );
+                               $start = $end - $matchLen;
+                               if ( $start < 0 ) {
+                                       $start = 0;
+                               }
+                               $groupedNumber = substr( $_ , $start, $end -$start ) . $groupedNumber ;
+                               $end = $start;
+                               if ( $numMatches > 1 ) {
+                                       // use the last pattern for the rest of the number
+                                       $numMatches--;
+                               }
+                               if ( $start > 0 ) {
+                                       $groupedNumber = "," . $groupedNumber;
+                               }
                        }
                        return $groupedNumber;
                }