phpretard Posted September 18, 2008 Share Posted September 18, 2008 This works fine for a remainder. I can't figure a way to display Zeros the result is for instance $100.00 Now it will only display $100 $price=round($multiplier*.0275, 2); Any help, pointer, quick code snips...? Link to comment https://forums.phpfreaks.com/topic/124774-roundhelp-please-simple/ Share on other sites More sharing options...
akitchin Posted September 18, 2008 Share Posted September 18, 2008 have a look at using number_format() with a 2 for decimals after performing the round()ing. Link to comment https://forums.phpfreaks.com/topic/124774-roundhelp-please-simple/#findComment-644553 Share on other sites More sharing options...
phpretard Posted September 18, 2008 Author Share Posted September 18, 2008 So somthing like this? $price=round($multiplier*.0275, 2 ,",","."); Link to comment https://forums.phpfreaks.com/topic/124774-roundhelp-please-simple/#findComment-644559 Share on other sites More sharing options...
akitchin Posted September 18, 2008 Share Posted September 18, 2008 So somthing like this? $price=round($multiplier*.0275, 2 ,",","."); i'm not sure where you got that from, round() is still only a two-parameter function. try this: $price = number_format(round($multiplier*0.0275, 2), 2); Link to comment https://forums.phpfreaks.com/topic/124774-roundhelp-please-simple/#findComment-644735 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.