Copy link to clipboard
Copied
I have text field in which I will input numbers I need something to add leading zeroes to numbers (6)
if I enter 1, field should show 000001 if I enter 1234 field should show 001234 can you help?
You can use this as custom format script:
if(event.value)
event.value = util.printf("%06d", event.value);
Copy link to clipboard
Copied
You can use this as custom format script:
if(event.value)
event.value = util.printf("%06d", event.value);
Copy link to clipboard
Copied
Just be aware the above code will not change the actual field value, only the way it is displayed.
If you export or copy it, it will still be without those zeros.
Copy link to clipboard
Copied
Thanks, @try67, I do need to keep original value and show zeroes just for display.