r32012 - Code Review

From MediaWiki.org

Jump to: navigation, search
Repository:MediaWiki
Revision:r32011 | r32012 (on ViewVC) | r32013 >
Date:10:39, 15 March 2008
Author:nikerabbit
Status:ok
Tags:
Comment:* Magic word formatnum can now take raw suffix to undo formatting
Modified paths:

Diff [purge]

Index: trunk/phase3/includes/CoreParserFunctions.php
===================================================================
--- trunk/phase3/includes/CoreParserFunctions.php	(revision 32011)
+++ trunk/phase3/includes/CoreParserFunctions.php	(revision 32012)
@@ -138,8 +138,12 @@
 		}
 	}
 
-	static function formatNum( $parser, $num = '' ) {
-		return $parser->getFunctionLang()->formatNum( $num );
+	static function formatNum( $parser, $num = '', $raw = null) {
+		if ( self::israw( $raw ) ) {
+			return $parser->getFunctionLang()->parseFormattedNumber( $num );
+		} else {
+			return $parser->getFunctionLang()->formatNum( $num );
+		}
 	}
 
 	static function grammar( $parser, $case = '', $word = '' ) {
Index: trunk/phase3/RELEASE-NOTES
===================================================================
--- trunk/phase3/RELEASE-NOTES	(revision 32011)
+++ trunk/phase3/RELEASE-NOTES	(revision 32012)
@@ -44,6 +44,7 @@
 * When a page doesn't exist, the tab should say "create", not "edit"
 * (bug 12882) Added a span with class "patrollink" arround "Mark as patrolled"
   link on diffs
+* Magic word formatnum can now take raw suffix to undo formatting
 
 === Bug fixes in 1.13 ===
 
Views
Toolbox