jagguy Posted April 1, 2007 Share Posted April 1, 2007 Hi, I have a mysql field (decimal) that has eg 20.0565 and I want 2 number after decimal point and not 4. How do i do that? Also can i place a stroke through a number $47.14 ------ these 2 overlap? Link to comment https://forums.phpfreaks.com/topic/45118-php-price/ Share on other sites More sharing options...
phpQuestioner Posted April 1, 2007 Share Posted April 1, 2007 try this: $number = 1234.5678; $english_format_number = number_format($number, 2, '.', ''); or this: $number = 1234.56; echo money_format('%i', $number) . "\n"; // USD 1,234.56 Link to comment https://forums.phpfreaks.com/topic/45118-php-price/#findComment-219041 Share on other sites More sharing options...
jagguy Posted April 1, 2007 Author Share Posted April 1, 2007 thanks for that. Do you know about placing a stroke through a number $47.14 ------ these 2 overlap? Link to comment https://forums.phpfreaks.com/topic/45118-php-price/#findComment-219066 Share on other sites More sharing options...
wildteen88 Posted April 1, 2007 Share Posted April 1, 2007 thanks for that. Do you know about placing a stroke through a number $47.14 ------ these 2 overlap? what do you mean by that? Post examples. DO you want to format to be like this? $47-14 Link to comment https://forums.phpfreaks.com/topic/45118-php-price/#findComment-219075 Share on other sites More sharing options...
AndyB Posted April 1, 2007 Share Posted April 1, 2007 or maybe the OP means using a strikethru font attribute like <strike>this - if it shows up</strike> Link to comment https://forums.phpfreaks.com/topic/45118-php-price/#findComment-219078 Share on other sites More sharing options...
jagguy Posted April 2, 2007 Author Share Posted April 2, 2007 or maybe the OP means using a strikethru font attribute like <strike>this - if it shows up</strike> I meant like you said with a strike through and i see the tag. Link to comment https://forums.phpfreaks.com/topic/45118-php-price/#findComment-219478 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.