Why does this error occurs?
code:
setlocale(LC_MONETARY, "en_US");
$pricetotal = money_format("%10.2n", $pricetotal);
Server details.
Apache Version : 2.2.21
PHP Version : 5.3.8
I’m getting the following Error
Fatal error: Call to undefined function money_format()
From the manual:
money_format()is basically a wrapper around the C library functionstrfmon()as the manual states.If you check the comments, there is an implementation by Rafael M. Salvioni. Worth a try. You can check if it’s already defined using function_exists().
Answers to this StackOverflow question give further (and possibly better) alternatives (thx danielson317).