pwaterma Posted May 11, 2006 Share Posted May 11, 2006 I am having a heck of a time finding out how to format numbers displayed from a query. Can someone show me how to make format Salary with commas?Much appreciated<td><?php echo $row_Recordset1['Salary']; ?></td><td><?php echo $row_Recordset1['Cap_hit']; ?></td><td><?php echo $row_Recordset1['Cap_hit_preJune']; ?></td><td><?php echo $row_Recordset1['Cap_hit_postJune']; ?></td> Link to comment https://forums.phpfreaks.com/topic/9520-format-number-on-echo-row/ Share on other sites More sharing options...
toplay Posted May 11, 2006 Share Posted May 11, 2006 Look at using one of these two functions:[a href=\"http://us2.php.net/number_format\" target=\"_blank\"]http://us2.php.net/number_format[/a][a href=\"http://us2.php.net/manual/en/function.money-format.php\" target=\"_blank\"]http://us2.php.net/manual/en/function.money-format.php[/a] Link to comment https://forums.phpfreaks.com/topic/9520-format-number-on-echo-row/#findComment-35144 Share on other sites More sharing options...
pwaterma Posted May 11, 2006 Author Share Posted May 11, 2006 [!--quoteo(post=373164:date=May 10 2006, 08:12 PM:name=toplay)--][div class=\'quotetop\']QUOTE(toplay @ May 10 2006, 08:12 PM) [snapback]373164[/snapback][/div][div class=\'quotemain\'][!--quotec--]Look at using one of these two functions:[a href=\"http://us2.php.net/number_format\" target=\"_blank\"]http://us2.php.net/number_format[/a][a href=\"http://us2.php.net/manual/en/function.money-format.php\" target=\"_blank\"]http://us2.php.net/manual/en/function.money-format.php[/a][/quote]i have looked at these and others. they all appear to be formatting a value that is manually defined.$number = 1234.56;i don't understand how to apply it to $row_Recordset1['Salary']; Link to comment https://forums.phpfreaks.com/topic/9520-format-number-on-echo-row/#findComment-35146 Share on other sites More sharing options...
toplay Posted May 11, 2006 Share Posted May 11, 2006 <td><?php echo number_format($row_Recordset1['Salary']); ?></td> Link to comment https://forums.phpfreaks.com/topic/9520-format-number-on-echo-row/#findComment-35147 Share on other sites More sharing options...
pwaterma Posted May 11, 2006 Author Share Posted May 11, 2006 [!--quoteo(post=373167:date=May 10 2006, 08:48 PM:name=toplay)--][div class=\'quotetop\']QUOTE(toplay @ May 10 2006, 08:48 PM) [snapback]373167[/snapback][/div][div class=\'quotemain\'][!--quotec--]<td><?php echo number_format($row_Recordset1['Salary']); ?></td>[/quote]perfect thank you so much! Link to comment https://forums.phpfreaks.com/topic/9520-format-number-on-echo-row/#findComment-35148 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.