Jump to content

[SOLVED] Help with money_format()


DBookatay

Recommended Posts

When I use the following:

setlocale(LC_MONETARY, 'en_US');
$balance = money_format('%(#10n', $row['balance']);
$down = money_format('%(#10n', $row['down']);

 

I get this error:

Warning: money_format() expects parameter 2 to be double, string given in /home/.phillipina/dbookatay/login.carcityofdanbury.com/passed/New/list.php on line 329

Link to comment
https://forums.phpfreaks.com/topic/69055-solved-help-with-money_format/
Share on other sites

Solved it myself...

(Don't know if this is the correct way, but it works.)

setlocale(LC_MONETARY, 'en_US');
if ($row['balance']) {$balance = money_format('%(#10n', $row['balance']);} else {$balance = '';}
if ($row['down']) {$down = money_format('%(#10n', $row['down']);} else {$down = '';}

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.