redarrow Posted October 20, 2009 Share Posted October 20, 2009 i think i finally solved this anybody. last time i was getting the wrong results. <?php // price of item. $price="100.00"; //quenity of items. $quenity="7"; // tax rate. $tax="17.50"; //discount rate. $discount="25%"; // monthly payments. $payments="12"; //total price x queniety. $total=$price*$quenity; // add pretax up, divide tax via 100. $pretax=$tax/100; //add a 1 to pretax to get the decimal point. $total_tax=$pretax+1; //total with out tax. $total_with_out_tax=$total; //total with tax. $total_with_tax=$total*$total_tax; //total with discount. $total_with_discount=$total_with_tax-$discount; //monthly payments. $monthly_payments=$total_with_tax/$payments; echo "£".number_format($total_with_discount,2).""; ?> yeee haaaa, sorry was solved my fault. Link to comment https://forums.phpfreaks.com/topic/178355-solved-adding-up-might-be-solved-tell-us-cheers/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.