Skip to main content
Known Participant
April 22, 2024
Answered

format of a field with a formula

  • April 22, 2024
  • 1 reply
  • 781 views

Hi,

I am attaching a form with a simple formula in field 20, where we add up fields 10-19.
How do I change the format of field 20 so that '0' does not appear if none of the fields from 10 to 19 are filled ?

Thank you very much for your help !

WS.

This topic has been closed for replies.
Correct answer Nesa Nurani

Use this as custom format script:
if(event.value){
event.value = util.printf("%,2.2f",event.value).toString().replace(/\./gim," ");}

Then use this as 'Validate' script:
if(event.value == 0)
event.value = "";

1 reply

Nesa Nurani
Community Expert
Nesa NuraniCommunity ExpertCorrect answer
Community Expert
April 22, 2024

Use this as custom format script:
if(event.value){
event.value = util.printf("%,2.2f",event.value).toString().replace(/\./gim," ");}

Then use this as 'Validate' script:
if(event.value == 0)
event.value = "";

Known Participant
April 22, 2024

Thank YOU ! ❤🌹🌹🌹🌹🌹