niche Posted October 5, 2010 Share Posted October 5, 2010 Can't get this to work. It's a copy/paste from http://www.w3schools.com/PHP/func_string_money_format.asp. Nothing like this has ever happened on this system before. <?php$number = -1234.5672;echo money_format("%=*(#10.2n", $number);?> Link to comment Share on other sites More sharing options...
ShadowMage Posted October 5, 2010 Share Posted October 5, 2010 Are you on Windows?It states right there on the reference page: Note: The money_format() function does not work on Windows platforms.EDIT: Strangely enough, I don't see anything on the PHP Manual page about it though... :)EDIT2: Ooops, yeah it is there. Link to comment Share on other sites More sharing options...
thescientist Posted October 5, 2010 Share Posted October 5, 2010 did you read up on it on the php manual? http://us3.php.net/manual/en/function.money-format.phpdoes this apply to you? Note:The function money_format() is only defined if the system has strfmon capabilities. For example, Windows does not, so money_format() is undefined in Windows. Link to comment Share on other sites More sharing options...
justsomeguy Posted October 5, 2010 Share Posted October 5, 2010 There's a version of the function posted in the comments on the manual page. Link to comment Share on other sites More sharing options...
niche Posted October 5, 2010 Author Share Posted October 5, 2010 I went to the manual, after failing at w3schools, looking for tips for making it work not for reasons it won't work. Guess I found what I wanted not what I needed. Turns out "$". $amt was much simpler. Thanks to ShadowMage, thescientist, and justsomeguy for their help.Niche Link to comment Share on other sites More sharing options...
Synook Posted October 6, 2010 Share Posted October 6, 2010 money_format() is localised, though, which is probably its main advantage (along with the pretty formatting). Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.