Jump to content

Whats Wrong With this Code?


PHP-Nut

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/76980-whats-wrong-with-this-code/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.