Join the forums now, and start posting to receive access to our Scripts Vault!
function prettynum($num,$dollar="0") {// Basic send a number or string to this and it will add commas. If you want a dollar sign added to the// front and it is a number add a 1 for the 2nd variable.// Example prettynum(123452838,1) will return $123,452,838 take out the ,1 and it looses the dollar sign. $out=strrev( (string)preg_replace( '/(\d{3})(?=\d)(?!\d*\.)/', '$1,' , strrev( $num ) ) ); if ($dollar && is_numeric($num)){ $out= "$".$out; } return $out;}
function prettynum($num,$dollar="0") {// Basic send a number or string to this and it will add commas. If you want a dollar sign added to the// front and it is a number add a 1 for the 2nd variable.// Example prettynum(123452838,1) will return $123,452,838 take out the ,1 and it looses the dollar sign. $out=strrev( (string)preg_replace( '/(\d{3})(?=\d)(?!\d*\.)/', '$1,' , strrev( $num ) ) ); if ($dollar && is_numeric($num)){ $out= "$".number_format($out); } return $out;}
$this->money = $worked['money'];<--- in classes.phpthen in header.php ------> $out = str_replace("<!_-money-_!>", $user_class->money, $out);
$out = str_replace("<!_-money-_!>", prettynum($user_class->money,1), $out);
$out = str_replace("<!_-money-_!>", prettynum($user_class->money), $out);