Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Calculation in a PDF document

New Here ,
Oct 12, 2016 Oct 12, 2016

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

TOPICS
Acrobat SDK and JavaScript
398
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 13, 2016 Oct 13, 2016
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 14, 2016 Oct 14, 2016
LATEST

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines