DBookatay Posted April 27, 2007 Share Posted April 27, 2007 Can someone explain this error to me: Warning: money_format() expects exactly 2 parameters, 1 given in /home/.phillipina/login.carcityofdanbury.com/passed/forms_view.php on line 170 I am trying to turn a number into currency... $finChrg = money_format($row[finChrg]); Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted April 27, 2007 Share Posted April 27, 2007 Did you read the manual entry for the money_format() function? You need to pass it two parameters. The first is the format string, the second is the number. Ken Quote Link to comment Share on other sites More sharing options...
DBookatay Posted April 27, 2007 Author Share Posted April 27, 2007 Did you read the manual entry for the money_format() function? You need to pass it two parameters. The first is the format string, the second is the number. Ken Right, but how is this achieved? Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted April 27, 2007 Share Posted April 27, 2007 $finChrg = money_format('%i', $row[finChrg]); Quote Link to comment Share on other sites More sharing options...
DBookatay Posted April 27, 2007 Author Share Posted April 27, 2007 $finChrg = money_format('%i', $row[finChrg]); This works correctly, but is there a way to remove the "USD" that gets outputted? Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted April 27, 2007 Share Posted April 27, 2007 setlocale(LC_MONETARY, 'en_US'); echo money_format('%(#10n', $row[finChrg]); Quote Link to comment Share on other sites More sharing options...
DBookatay Posted April 27, 2007 Author Share Posted April 27, 2007 setlocale(LC_MONETARY, 'en_US'); echo money_format('%(#10n', $row[finChrg]); Thanks man, that did the trick... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.