chrisbcats Posted June 6, 2006 Share Posted June 6, 2006 How do I format php variables?I have several calculated php variables. How do I format the variables in decimal and whole number format?ex:$netValue = 874.76233$net = 8952038I need the variables to return:$netValue = 874.76$net = 8,952,038 Link to comment https://forums.phpfreaks.com/topic/11302-solved-format-variables/ Share on other sites More sharing options...
KrisNz Posted June 6, 2006 Share Posted June 6, 2006 [a href=\"http://php.net/printf\" target=\"_blank\"]printf[/a] is what you're after Link to comment https://forums.phpfreaks.com/topic/11302-solved-format-variables/#findComment-42325 Share on other sites More sharing options...
wildteen88 Posted June 6, 2006 Share Posted June 6, 2006 or [a href=\"http://uk2.php.net/manual/en/function.number-format.php\" target=\"_blank\"]number_format[/a] [img src=\"style_emoticons/[#EMO_DIR#]/laugh.gif\" style=\"vertical-align:middle\" emoid=\":laugh:\" border=\"0\" alt=\"laugh.gif\" /] Link to comment https://forums.phpfreaks.com/topic/11302-solved-format-variables/#findComment-42441 Share on other sites More sharing options...
chrisbcats Posted June 7, 2006 Author Share Posted June 7, 2006 Thank you both! I better understood number_format. Link to comment https://forums.phpfreaks.com/topic/11302-solved-format-variables/#findComment-42654 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.