Skip to main content
Participant
July 3, 2020
Question

trying to return a value entered to multiply by 200% if less then, 175% if less then, and so on..

  • July 3, 2020
  • 1 reply
  • 273 views

i am trying to return a value entered in "VehicleTradeValue", If number is less then or equal to 6000, then multiply by 200%, if value is greater then 6000 but less then 9000 , multiply by 175% and so on..

the equation below adds 10%... not sure why....

 

var vtv = this.getField("VehicleTradeValue").value;
if( vtv <= 6000) event.value = (vtv * 2.0);
else if ( vtv <= 9000) event.value = (vtv * 1.75);
else if( vtv <= 11000) event.value = (vtv * 1.50);
else if( vtv <= 12000) event.value = (vtv * 1.40);
else if( vtv <= 13000) event.value = (vtv * 1.35);
else if( vtv <= 14000) event.value = (vtv * 1.30);
else if( vtv <= 17000) event.value = (vtv * 1.25);
else if( vtv <= 20000) event.value = (vtv * 1.20);
else if( vtv <= 24000) event.value = (vtv * 1.15);
else( vtv <= 200000) event.value = (vtv * 1.10);

This topic has been closed for replies.

1 reply

Bernd Alheit
Community Expert
Community Expert
July 3, 2020

Add a if after the last else.