Jump to content

Money Format


Recommended Posts

Hi everyone, im echoing a number value from my table as a number, I need to convert this to money format and ive found

setlocale(LC_MONETARY, 'en_US');
echo money_format('%i', $number) . "\n";

 

how can i have this format my own variable?

<?php echo $row_getsum['SUM_value']; ?>

 

Would it be...

setlocale(LC_MONETARY, 'en_US');
echo money_format('%i', $number . row_getsum['SUM_value'] . "\n";

Link to comment
Share on other sites

Thought id cracked it! Ive just tried

			<?php
setlocale(LC_MONETARY, 'en_GB');
$locale_info = localeconv();
print_r($locale_info);
?>

which when outputting shown my currency symbol as


[currency_symbol] => �

 

Does anybody know what causes this and how I can fix it?

 

Set the correct character set.

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.