by default, this means that everyone that doesn't have a formatNum function
will see the en_* format but those that do will continue to see what they
already do.
* a floating point number.
*/
function formatNum( $number ) {
- return $number;
+ return $this->commafy($number);
}
-
+
+ /**
+ * Adds commas to a given number
+ *
+ * @param mixed $_
+ * @return string
+ */
+ function commafy($_) {
+ return strrev((string)preg_replace('/(\d{3})(?=\d)(?!\d*\.)/','$1,',strrev($_)));
+ }
+
function listToText( $l ) {
$s = '';
$m = count($l) - 1;