Index: trunk/phase3/tests/phpunit/languages/LanguageMlTest.php |
— | — | @@ -30,5 +30,7 @@ |
31 | 31 | $this->assertEquals( '-98', $this->lang->formatNum( '-98' ) ); |
32 | 32 | $this->assertEquals( '-98', $this->lang->formatNum( -98 ) ); |
33 | 33 | $this->assertEquals( '-1,23,45,678', $this->lang->formatNum( -12345678 ) ); |
| 34 | + $this->assertEquals( '', $this->lang->formatNum( '' ) ); |
| 35 | + $this->assertEquals( '', $this->lang->formatNum( null ) ); |
34 | 36 | } |
35 | 37 | } |
Index: trunk/phase3/languages/Language.php |
— | — | @@ -2729,6 +2729,9 @@ |
2730 | 2730 | */ |
2731 | 2731 | function commafy( $_ ) { |
2732 | 2732 | $digitGroupingPattern = $this->digitGroupingPattern(); |
| 2733 | + if ( $_ === null ) { |
| 2734 | + return ''; |
| 2735 | + } |
2733 | 2736 | |
2734 | 2737 | if ( !$digitGroupingPattern || $digitGroupingPattern === "###,###,###" ) { |
2735 | 2738 | // default grouping is at thousands, use the same for ###,###,### pattern too. |