Skip to main content
Known Participant
Sep 1, 2023 2:07 PM UTC
Question

Unwanted Zeros Appears in Calculated Field Text Boxes

Hello,

I am preparing a form for our shipping department and I have it set up to calculate taxes, palletizing, etc and give a total.  At first, it was giving me numbers with a bunch of decimal places like $37.555555557778 so I set the format to number and 2 decimals.  It also makes an unwanted zero appear in that space even though no data has been entered yet.  How can I fix this?  I want my calculations to remain the same and for the numbers to only display 2 decimal places but I don't want the zero there because we sometimes have to fill out the form manually.  I have very little experience with java script, I read up on some things but they do not make any sense to me.  If there is a flat out formula you know that I can just copy and paste to the custom format box that achieves this, please just let me know.  I greatly appreciate any help and thank you for your time.  If this post is duplicated, I apologize, I think I posted it in the wrong area.

12 replies

Nesa Nurani
Community Expert
Community Expert
Sep 1, 2023 2:32 PM UTC

As 'Validate' script of those fields, use this:

if(event.value == 0)event.value = "";
Translate
johnsboxAuthor
Known Participant
Sep 1, 2023 7:03 PM UTC

Do I go to the validate tab and run custom validation script?

Translate
Nesa Nurani
Community Expert
Community Expert
Sep 1, 2023 7:26 PM UTC

Yes.

Translate