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 Quote Link to comment 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] Quote Link to comment Share on other sites More sharing options...
brown2005 Posted August 9, 2006 Share Posted August 9, 2006 was that ok mate? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.