Skip to main content
Participant
April 25, 2017
Answered

How can I use conditional formatting for numbers with up to 5 decimal places.

  • April 25, 2017
  • 2 replies
  • 777 views

I have a number range from 1.77150 to 1.77221 and I would like it to turn red if it is outside that range.

This topic has been closed for replies.
Correct answer try67

As the field's custom validation script enter this code:

if (event.value>=1.77150 && event.value<=1.77221) event.target.textColor = color.red;

else event.target.textColor = color.black;

2 replies

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
April 25, 2017

As the field's custom validation script enter this code:

if (event.value>=1.77150 && event.value<=1.77221) event.target.textColor = color.red;

else event.target.textColor = color.black;

dmdowsettAuthor
Participant
April 25, 2017

OK, for some reason that didn't work, but I changed the color coding around so first line black and second line red and that was it, thank you.

try67
Community Expert
Community Expert
April 25, 2017

Sorry, I didn't notice you want it to be red if it's outside that range. Yes, changing the colors should solve that.

Inspiring
April 25, 2017

You have to use the custom JavaScript option on the Validation tab for the field's properties. Since you are focused on that field when validating, use the "event.value".

dmdowsettAuthor
Participant
April 25, 2017

Right but it only seems to work on whole numbers.