Jump to content

Can't get money_format to work


Eiolon

Recommended Posts

If I put this in a new HTML document:

 

<?php

$number = 1234.56;

// let's print the international format for the en_US locale
setlocale(LC_MONETARY, 'en_US');
echo money_format('%i', $number) . "\n";
// USD 1,234.56

?>

 

as per the PHP manual, I get:

 

Fatal error: Call to undefined function money_format() in C:\wamp\www\accounts\test.php on line 7

 

Line 7 is:  echo money_format('%i', $number) . "\n";

 

 

I have tried setting different locales and same result.  Any ideas on what I need to do to get it to work?

Link to comment
https://forums.phpfreaks.com/topic/216904-cant-get-money_format-to-work/
Share on other sites

Jeez, I was thinking it came in around 5.1 or so . . . Anyhow, just noticed you're on WinD'ohs. From the manual also:

 

    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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.