Error message if it exceeds number of decimal places

Hello everyone. I am here to ask this question.

When one clarifies the number of decimal numbers allowed, when exceeding said number of figures, an error message appears that says "This entry is invalid" and it is logical that this is the case if we initially configure the field to have 3 decimal places, for example.

The fact is that the user has no way of knowing that the error is coming from excess decimals unless it is made clear to him with an error message.

Do any of you know how to ask the app to explain that the number of decimals has been exceeded?

THANK YOU VERY MUCH, HAVE A GOOD DAY

0 4 2,209
4 REPLIES 4

Aurelien
Google Developer Expert
Google Developer Expert

Hi @Gustavo_Eduardo 

 

You can explicit the reason of the invalid message in the Data Validity/Invalid value error

Hello @Aurelien I understand, yes, it is in "Data validation error message", what I need is the formula that verifies that the number of decimals has been exceeded.

Something like reading the entered number and, if it exceeds a certain number of decimal places, throw a message, for example, "you have typed a number with 4 decimal places, only a maximum of 3 is allowed"

With what formula do I read a number and return the quantity of decimal numbers.

It could be:

 

 

IF(LEN([_THIS])-LEN(ROUND([_THIS]))>4, 
  "you exceeded the limit of 4 decimals instead of 3 in your entry",
  "Invalid input"
)

 

EDIT: corrected in order to try catching the decimal (not understood at first)

 

Ok, thank you very much @Aurelien I'll try and let you know.

Top Labels in this Space