dlf1987 Posted May 9, 2007 Share Posted May 9, 2007 Hi, I dont know if it will work in PHP, but is there a way to do sumthing like this asp code <%= FormatCurrency((rsorders.Fields.Item("OrderShipping").Value), 2, -2, -2, -2) %> but with php? In ASP it formats it as money, it also shows the $ (dollar sign) in front, and two decimals at the end Thanks Link to comment https://forums.phpfreaks.com/topic/50701-solved-php-money-symbol/ Share on other sites More sharing options...
utexas_pjm Posted May 9, 2007 Share Posted May 9, 2007 http://us.php.net/money_format Link to comment https://forums.phpfreaks.com/topic/50701-solved-php-money-symbol/#findComment-249238 Share on other sites More sharing options...
dlf1987 Posted May 9, 2007 Author Share Posted May 9, 2007 $number = 1234.56; setlocale(LC_MONETARY, 'en_US'); echo money_format('%i', $number) . "\n"; I tried this, but it gives me a error " Fatal error: Call to undefined function money_format() " Link to comment https://forums.phpfreaks.com/topic/50701-solved-php-money-symbol/#findComment-249275 Share on other sites More sharing options...
utexas_pjm Posted May 9, 2007 Share Posted May 9, 2007 Ahhh, sorry I forgot to mention that money_format is undefined in Windows and any other systems which do not have the C library function strfmon(). You'll have to settle for: http://us2.php.net/number_format. Best, Patrick Link to comment https://forums.phpfreaks.com/topic/50701-solved-php-money-symbol/#findComment-249285 Share on other sites More sharing options...
dlf1987 Posted May 9, 2007 Author Share Posted May 9, 2007 thanks much! Link to comment https://forums.phpfreaks.com/topic/50701-solved-php-money-symbol/#findComment-249287 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.