Snippet Name: Format money as millions, billions, etc
Description: This function formats a money amount into an abbreviated form. It takes a number like "1,246,743" and formats it as "1.25 million", (or billion, trillion, etc.)
Language: PHP Highlight Mode: PHP Last Modified: June 27th, 2010
FUNCTION format_cash($cash){// strip any commas $cash=(0+STR_REPLACE(',','',$cash));// make sure it's a number...IF(!IS_NUMERIC($cash)){RETURNFALSE;}// filter and format it IF($cash>1000000000000){RETURNROUND(($cash/1000000000000),2).' trillion';}ELSEIF($cash>1000000000){RETURNROUND(($cash/1000000000),2).' billion';}ELSEIF($cash>1000000){RETURNROUND(($cash/1000000),2).' million';}ELSEIF($cash>1000){RETURNROUND(($cash/1000),2).' thousand';}RETURNNUMBER_FORMAT($cash);}
SQL University.net courses meet the most demanding needs of the business world for advanced education
in a cost-effective manner. SQL University.net courses are available immediately for IT professionals
and can be taken without disruption of your workplace schedule or processes.
Compared to traditional travel-based training, SQL University.net saves time and valuable corporate
resources, allowing companies to do more with less. That's our mission, and that's what we deliver.