Index: trunk/extensions/CentralNotice/SpecialNoticeText.php |
— | — | @@ -167,6 +167,13 @@ |
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 | 178 | $lang = Language::factory( $this->language ); |
172 | 179 | return $lang->formatNum( $num ); |
173 | 180 | } |