PHP-Nut Posted November 12, 2007 Share Posted November 12, 2007 I have a list of products in a database and show the price based on a calculation of cost+vat * markup all is working fine until the result would be 4 figures in front of the decimal point. then it returns 1 (or 0.99 as is my code) <?php echo round(number_format($row_newprodRst['price']*1.175*$row_newprodRst['mup'],2))-0.01; ?> for example if the result = 999.99 then thats fine Anything that would result in a higher number fails and shows 0.99 ( ???) Im sure there is a simple answer Paul. Quote Link to comment Share on other sites More sharing options...
Dragen Posted November 12, 2007 Share Posted November 12, 2007 try doing the number format after the round. It may be that the ',' mucks up the rounding. not sure though.. Quote Link to comment Share on other sites More sharing options...
PHP-Nut Posted November 12, 2007 Author Share Posted November 12, 2007 Yes that Seams to Work..... Strange Thanks Paul. 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.