vendredi 29 avril 2016

Javascript if function

I have a very simple java calculator which includes 9 check box input choice, a, b, c, d, e, f, g, h, i

I have created a simple script to calculate the overall total (output property name a) based on input selection as follows:

return {  a: inputs.a + inputs.b*2 + inputs.c*3 + inputs.d + inputs.e + inputs.f + inputs.g + inputs.h + inputs.i }

I wish to include another calculation which returns a specific value (output property name b) based on the cal.

If a = 0 then b value should display 0.7% or if a = 1, b value should display 1.1% or if a = 2, b = 1.7% or if a = 3, b = 2.7% or if a = 4, b = 4.4% or if a = 5, b = 6.9% or if a = 6, b = 11% or if a = 7, b = 16% or if a = 8, b = 24% or if a = 9, b = 34% or if a = 10, b = 45% or if ...

I hope this makes sense

Thank you

Aucun commentaire:

Enregistrer un commentaire