jeudi 2 juillet 2020

trying to get this script to work in Adobe Javascript calculation field, so close

Im trying to get this script to work in Adobe Javascript calculation field, so close... would appreciate the help. Point of this is to return vehicle trade value multiplied by range provided.

var vtv = Number(this.getField("VehicleTradeValue").valueAsString);
  if(vtv > 0)
    vtv *= 2;

  else if(vtv < 6000)
    vtv *= 1.9;

  else if(vtv < 9000)
    vtv *= 1.75;

  else if(vtv < 11000)
    vtv *= 1.5;

  else if(vtv < 12000)
    vtv *= 1.4;

  else if(vtv < 13000)
    vtv *= 1.35;

  else if(vtv < 14000)
    vtv *= 1.3;

  else if(vtv < 17000)
    vtv *= 1.25;

  else if(vtv < 20000)
    vtv *= 1.2;

  else if(vtv < 24000)
    vtv *= 1.15;

  else
    vtv *= 1.1;

  event.value(vtv)

Aucun commentaire:

Enregistrer un commentaire