jacko_162 Posted February 14, 2011 Share Posted February 14, 2011 I am looking into sotring values in the sql database as "29824478.15" for example, now i use the number_format function to display as: 29,824,478 is it possible to get it to display as: 29.8m if its a million number and 0.29m if its less than a million for example? Link to comment https://forums.phpfreaks.com/topic/227583-number_format-question-for-currency/ Share on other sites More sharing options...
Porl123 Posted February 14, 2011 Share Posted February 14, 2011 Wouldn't you just divide the number by a million and add a 'm' after it? Link to comment https://forums.phpfreaks.com/topic/227583-number_format-question-for-currency/#findComment-1173865 Share on other sites More sharing options...
jacko_162 Posted February 14, 2011 Author Share Posted February 14, 2011 haha so you do... nearly 1am and i have been coding for 6 hours... getting tired. Thx Link to comment https://forums.phpfreaks.com/topic/227583-number_format-question-for-currency/#findComment-1173867 Share on other sites More sharing options...
Porl123 Posted February 14, 2011 Share Posted February 14, 2011 No probs Link to comment https://forums.phpfreaks.com/topic/227583-number_format-question-for-currency/#findComment-1173868 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.