jkkenzie Posted April 23, 2008 Share Posted April 23, 2008 Hi! i would like to put a comma in between a value from my database when displaying on the page. e.g i want to put a comma from left, every after three characters from decimal point of the value 1000000.00. Any code to do this? i never tried this so i don't have any idea, i only have in Ms Access. Thanks again. Regards, Joseph Link to comment https://forums.phpfreaks.com/topic/102465-use-comma-on-interger-values-for-currency/ Share on other sites More sharing options...
thebadbad Posted April 23, 2008 Share Posted April 23, 2008 <?php $n = 1000000.00; echo number_format($n, 2); //comma as thousands separator and 2 decimals //1,000,000.00 ?> Link to comment https://forums.phpfreaks.com/topic/102465-use-comma-on-interger-values-for-currency/#findComment-524724 Share on other sites More sharing options...
jkkenzie Posted April 23, 2008 Author Share Posted April 23, 2008 thanks, Link to comment https://forums.phpfreaks.com/topic/102465-use-comma-on-interger-values-for-currency/#findComment-524759 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.