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
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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.