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]); Link to comment https://forums.phpfreaks.com/topic/48963-solved-warning-money_format-expects-exactly-2-parameters-1-given/ 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 Link to comment https://forums.phpfreaks.com/topic/48963-solved-warning-money_format-expects-exactly-2-parameters-1-given/#findComment-239891 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? Link to comment https://forums.phpfreaks.com/topic/48963-solved-warning-money_format-expects-exactly-2-parameters-1-given/#findComment-239893 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]); Link to comment https://forums.phpfreaks.com/topic/48963-solved-warning-money_format-expects-exactly-2-parameters-1-given/#findComment-239913 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? Link to comment https://forums.phpfreaks.com/topic/48963-solved-warning-money_format-expects-exactly-2-parameters-1-given/#findComment-239917 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]); Link to comment https://forums.phpfreaks.com/topic/48963-solved-warning-money_format-expects-exactly-2-parameters-1-given/#findComment-239925 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... Link to comment https://forums.phpfreaks.com/topic/48963-solved-warning-money_format-expects-exactly-2-parameters-1-given/#findComment-239936 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.