Extension:NumberFormat

The NumberFormat extension allows to format numbers by grouping thousands and/or specifying the number of decimals to be shown. Additionally the number will be rounded if necessary. The symbols used as thousands separator and decimal point can optionally be specified.

This extension is most useful in conjunction with other extensions that print "raw" numbers — for example Semantic MediaWiki (see this tip on how to use NumberFormat with SMW).

NumberFormat is a simple wrapper for the PHP function and uses the same default values.

Usage
where:
 * 1) number - the number being formatted (default empty)
 * 2) decimals - sets the number of decimal points (default "0", set "_" for do not round)
 * 3) dec_point - sets the separator for the decimal point (default ".")
 * 4) thousands_sep - sets the thousands separator (default ",", "n" = "&amp;nbsp;" and "t" = "&amp;thinsp;")
 * 5) orig_dec_point - sets the separator for the decimal point in original number (default not set, if set - extension replace it to "." before use)

Installation
To install this extension, add the following to LocalSettings.php: