azraelGG Posted March 19, 2013 Share Posted March 19, 2013 hi im doin some custom coding and i need use ROUND with ALWAYS 2 decimals so if i enter 2 i need get back 2,00 with , not . Link to comment https://forums.phpfreaks.com/topic/275848-echo-prices/ Share on other sites More sharing options...
PaulRyan Posted March 19, 2013 Share Posted March 19, 2013 Try this: <?PHP $myNumber = 2; $number = number_format(ROUND($myNumber), 2, ',', ''); echo $number; Link to comment https://forums.phpfreaks.com/topic/275848-echo-prices/#findComment-1419515 Share on other sites More sharing options...
azraelGG Posted March 19, 2013 Author Share Posted March 19, 2013 Try this: <?PHP $myNumber = 2; $number = number_format(ROUND($myNumber), 2, ',', ''); echo $number; i tried with sprinf wrong way to do it this works great, thanks Link to comment https://forums.phpfreaks.com/topic/275848-echo-prices/#findComment-1419517 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.