JSHINER Posted April 27, 2007 Share Posted April 27, 2007 I currently use this to display a price: $z['LIST_PRICE'] Which displays a price as $100000. How can I make that display the price as $100,000, or $10,000, or $1,000,000 and so on. Link to comment https://forums.phpfreaks.com/topic/48981-solved-display-100000-as-100000/ Share on other sites More sharing options...
Psycho Posted April 27, 2007 Share Posted April 27, 2007 echo '$' . number_format (z['LIST_PRICE'], 0, '.', ','); Link to comment https://forums.phpfreaks.com/topic/48981-solved-display-100000-as-100000/#findComment-239960 Share on other sites More sharing options...
JSHINER Posted April 27, 2007 Author Share Posted April 27, 2007 When I do: echo'<b>$' . number_format($z['LIST_PRICE'],0'.',','); '</b>'; I get the error: Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in... Link to comment https://forums.phpfreaks.com/topic/48981-solved-display-100000-as-100000/#findComment-239972 Share on other sites More sharing options...
per1os Posted April 27, 2007 Share Posted April 27, 2007 <?php echo '<b>$' . number_format($z['LIST_PRICE'],0,'.',',') . '</b>'; ?> Try that. Link to comment https://forums.phpfreaks.com/topic/48981-solved-display-100000-as-100000/#findComment-239976 Share on other sites More sharing options...
Psycho Posted April 27, 2007 Share Posted April 27, 2007 Check again, you missed a comma. Or better yet, go look at the manual for number_format() to understand what all the parameters are. It is kind of difficult to understand what the parameters do in this situation. Link to comment https://forums.phpfreaks.com/topic/48981-solved-display-100000-as-100000/#findComment-239977 Share on other sites More sharing options...
JSHINER Posted April 27, 2007 Author Share Posted April 27, 2007 Yes I did miss a comma Thanks. I will take a look at that manual too. Thanks for the help. Link to comment https://forums.phpfreaks.com/topic/48981-solved-display-100000-as-100000/#findComment-239979 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.