komquat Posted August 8, 2006 Share Posted August 8, 2006 I need help formatting a number to a set decimal place.Please helpThanks in advance Link to comment https://forums.phpfreaks.com/topic/16906-format-a-number/ Share on other sites More sharing options...
brown2005 Posted August 8, 2006 Share Posted August 8, 2006 [code]<?php$number = 1234.56;$a = number_format($number, 2, '.', ',');$b = number_format($number, 3, '.', ',');echo "$a<br><br>$b";?>[/code] Link to comment https://forums.phpfreaks.com/topic/16906-format-a-number/#findComment-71194 Share on other sites More sharing options...
brown2005 Posted August 9, 2006 Share Posted August 9, 2006 was that ok mate? Link to comment https://forums.phpfreaks.com/topic/16906-format-a-number/#findComment-71672 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.