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

How can I calculate a field with leading zeros.

New Here ,
Aug 26, 2016 Aug 26, 2016

I have field 1 where the user enter 001, in field 2 it will be added 001, so it shows 002

Can you help with that, please?

TOPICS
Acrobat SDK and JavaScript
262
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 ,
Aug 26, 2016 Aug 26, 2016
LATEST

You can use this code as the custom calculation script for field 2"

event.value = util.printf("%03d", Number(this.getField("field 1").value)+1);

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