If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Calculating Percentage in a form

Hi there and thanks in advance for any assistance.
I am writing a form and doing a bunch of calculations one of which is a percentage based on the value selected. I am returning a correct result for two of the values but for the other two I am not.
Clearly I am missing something and maybe not testing for it but as I am clueless I can't think of what.
The 'discount' value is what I am looking for. It should return as 0 for values of 1 but it is doing the math as though it is multiplying by 1. And again for the value of 6 it should be 10&#37; but is taking the value as 4.6 or something.

Code is below I've included all of it (sorry) for better ease of understanding the math that is happening: