Skip to main content
Known Participant
October 12, 2016
Question

Calculation in a PDF document

  • October 12, 2016
  • 1 reply
  • 455 views

Hello, I have a calculation that takes place between two fields, between two dates, see example below. I would like the result to be rounded to the nearest whole number. Thank you for your help

(Date 1 - Date 2) / 365 = 5.67 I would like to round lower whole or 5

My code but i have not result

var date1 = this.getField("dateembauche").value;

var date2 = this.getField("dateanciennete").value;

event.value = Math.floor((date1 – date2)/365);

I try this

var date1 = this.getField("dateembauche").value;

var date2 = this.getField("dateanciennete").value;

var result = Math.floor((date1 – date2)/365);

Ce message a été modifié par : SWOON INTERNATIONAL

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
October 13, 2016
Known Participant
October 14, 2016

Thank you very much I will look and I think the answer.