Skip to main content
jant45441726
Participant
August 26, 2016
Question

How can I calculate a field with leading zeros.

  • August 26, 2016
  • 1 reply
  • 305 views

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?

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
August 26, 2016

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);