14 Replies Latest reply on Dec 7, 2016 12:26 PM by try67

    Round to whole number

    adstony187

      I am using Adobe Pro XI. Needing a javascript

       

      I am trying to get amount authorized.  I need to take the value is in field distance divide by 350.  Then take the whole number times it by the whole number.  Then the field distance value-350 to see if it is greater than or less than 50.  If it is equal to or less than 50 use the whole number if it is greater than 50 then use the whole number plus 1.  If the distance is 350 or less then would be 1.  I have no problem in excel doing it but I have not figure out how to get it all to work using the JAVAScripts.

       

      375/350=1.071

      1*350=350

      375-350=25

      is 25 > 50 =no

      returned value would be 1

       

      751/350=2.145

      2*350=700

      751-350=51

      is 51> 50 = yes

      2 + 1 = 3

      Returned value would be 3.