<?php function prettynum($num, $dollar = null) { global $mtgdb; $out = strrev((string) preg_replace('/(\d{3})(?=\d)(?!\d*\.)/', '$1,', strrev($num))); if($dollar && is_numeric($num)) { $out = "$" . $out; } return $out; } echo prettynum(123456),"<br />"; echo prettynum(123456, 1),"<br />"; echo number_format(123456);
You have javascript disabled. You will not be able to edit any code.