Fixed formatNum
authorTim Starling <tstarling@users.mediawiki.org>
Mon, 13 Feb 2006 09:09:54 +0000 (09:09 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Mon, 13 Feb 2006 09:09:54 +0000 (09:09 +0000)
languages/LanguageAf.php

index c25ceca..8e12961 100644 (file)
@@ -70,7 +70,17 @@ class LanguageAf extends LanguageUtf8 {
        }
 
        function formatNum( $number, $year = false ) {
-               return !$year ? strtr($this->commafy($number), '.,', ',.' ) : $number;
+               # South Africa uses space for thousands and comma for decimal
+               # Reference: AWS Reël 7.4 p. 52, 2002 edition
+               # glibc is wrong in this respect in some versions
+               if ( $year ) {
+                       return $number;
+               } else {
+                       return strtr($this->commafy($number), array(
+                               '.' => ',',
+                               ',' => "\xc2\xa0" // non-breaking space
+                       ));
+               }
        }
 
 }