well, i think you need to explain more. when I tried your demo, your discount came up as a percentage, but in your code you have $total=$total - $discount; which is just removing the amount entered in form, it's not removing a percentage of total.
again with taxrate, you have divided by 100, so if I entered 17.50 in box, it would become 1.75, then you add 1, so it would become 2.75. It is incorrect. Then you are multiplying total by 2.75.
So if I start with these in your form:
PRICE 20.00
QUIENTY 1
SHIPPING PRICE 10.00
DISCOUNT 10
TAX RATE 10
MONTHLY PAYMENTS 1
It SHOULD equal ...
PRICE x QUIENTY = 20.00
PRICE + SHIPPING = 30.00
then DISCOUNT 10% would equal 27.00
then TAX 10% would be 29.70
$total=$price * $quienty;//equal 20.00
$total=$total + $shipping;//equal 30.00
$_DISCOUNT = $total - (($total / 100) * $discount);//equal 27.00
$total=$total - $_DISCOUNT;
$_TAXRATE = $total + (($total / 100) * $taxrate);//equal 29.70
$total=$total + $_TAXRATE;
$monthly=$total / $payments;