Index: trunk/extensions/CentralNotice/SpecialNoticeText.php |
— | — | @@ -167,13 +167,10 @@ |
168 | 168 | } |
169 | 169 | |
170 | 170 | private function formatNum( $num ) { |
171 | | - // Reduce to millions |
172 | | - $num *= 0.000001; |
173 | | - // Grab the fractional part |
174 | | - $fraction = ( round( $num - 0.0455555, 1, PHP_ROUND_HALF_DOWN ) - floor( $num ) ) * 10; |
175 | | - // Only append the fractional part if it's more than 0 |
176 | | - $num = floatval( floor( $num ) . ( $fraction ? '.' . $fraction : '' ) ); |
177 | | - // Internationalize |
| 171 | + $num = sprintf("%.1f", $num/1e6); |
| 172 | + if ( substr( $num, -2 ) == '.0' ) { |
| 173 | + $num = substr( $num, 0, -2 ); |
| 174 | + } |
178 | 175 | $lang = Language::factory( $this->language ); |
179 | 176 | return $lang->formatNum( $num ); |
180 | 177 | } |