Ne0_Dev Posted May 15, 2010 Share Posted May 15, 2010 Hi Guys, I'm after a bit of help/guidance on an issue I am currently trying to resolve. I currently have a page where I use setlocale(LC_MONETARY) to automatically format values to a specific currency depending on which country parameter I pass to this function. At the moment I only require one currency for all values on the page. I am now trying to figure out a way to have different currency values on the same page and just wondered if it is possible to specify multiple setlocale on a page? If so I would need to use either an if/else/if statement or a switch statement to determine which one to use based on the country value of the record being returned from the database. At the moment I am specifying the setlocale in a php block at the top of the page. Any thoughts or suggestions are most appreciated. Ne_Dev Link to comment https://forums.phpfreaks.com/topic/201852-format-money-value-inconjunction-with-setlocale/ Share on other sites More sharing options...
ignace Posted May 15, 2010 Share Posted May 15, 2010 Remember that not all locale's may be supported. You can do: setlocale(LC_MONETARY, 'en_GB'); echo money_format('%n', $money); setlocale(LC_MONETARY', 'de_DE'); echo money_format('%n', $money); Link to comment https://forums.phpfreaks.com/topic/201852-format-money-value-inconjunction-with-setlocale/#findComment-1058702 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.