BadGoat Posted September 26, 2006 Share Posted September 26, 2006 Hello!I am wondering if there is a way to limit the # of digits when using PHP to perform mathematical computations? There are times when the output would have infinite points after the decimal, I am hoping there is a way to trim the # of digits... So far in my books I cannot find any info. Does anyone have a way to do this?Thanks! Quote Link to comment Share on other sites More sharing options...
craygo Posted September 26, 2006 Share Posted September 26, 2006 number_format()read up on it herehttp://us3.php.net/manual/en/function.number-format.php[code]<?php$number = 1.025654485;echo number_format($number, 3);?>[/code]Ray Quote Link to comment Share on other sites More sharing options...
BadGoat Posted September 26, 2006 Author Share Posted September 26, 2006 Thank you Ray, just what I needed ;D Quote Link to comment Share on other sites More sharing options...
craygo Posted September 26, 2006 Share Posted September 26, 2006 NP :) 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.