Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function currency_format($num,$currency='USD')
- {
- $str = '';
- $format = number_format($num,2, '.', ',');
- switch($currency)
- {
- case 'USD': $str .= '$'.$format ;
- break;
- /* case 'PHP':
- break; */
- }
- return $str;
- }
- echo currency_format(1000)."<br />";
- echo currency_format(1202100);
- ?>
Add Comment
Please, Sign In to add comment