Good Morning,
I finally made a php calculator program which combines compound interest and added fees, The only problem is when I use the the round() function if the fee ends in a zero it does not show the zero. example </php echo round($var,2);?> if $var equals let's say 3.001 the out put will only be 3, if $var equals 7.3000 the output would be 7.3.
what I would like is the output to be rounded to the next cent example if $var equals 3.001 the the output would be 3.00.
Is their a way to accomplish this? I'm sure I could change all the numerals back a hundreth and then multiply $var by .10, but I think the output would be the same.
Well if anyone has a suggestion I would greatly appreciate it. Thanks

9 Years
Discussion Span
Last Post by Dsiembab

*Opens new browser window*
*Loads php.net*
*Enters "cents" in the search box, and selects "Online Documentation" from the drop down.*
*Finds link to article about variable precision math*
*Posts link*

Perhaps this would be of some use?

*Clicks Link*
*Finds Link http://www.php.net/manual/en/function.bcadd.php*
*Fixes PHP Code*
*Thanks Puckdropper*
thanks appreciate it
*Starts Working On HTML Design for PHP Code*

This article has been dead for over six months. Start a new discussion instead.
Be sure to adhere to our posting rules.