Skip to main content
Question

Prevent hundredths value from numeric field

  • October 30, 2020
  • 0 replies
  • 33 views

Forum|alt.badge.img+6
Hello, 

I have a field (Hours), that should have entries that are whole numbers, or decimals in tenths of an hour (2.3). A lot of the time, users enter hundredths (2.25) instead. I don't want to automatically round, I just want to prevent the save from happening, and probably display a message like "Hours can only be entered in whole numbers or tenths of an hour". I thought using custom data rules might work, but I think I read somewhere that custom data rules aren't always reliable when users use grid edit, so I want to be sure whatever I do is 100% effective. Also, I need to prevent users from entering a value of 0; the # of hours should always be at least 0.1.​

If custom data rules would work, could someone provide a potential formula for this?

------------------------------
Harrison Smith
------------------------------
This topic has been closed for replies.

MarkShnierYou
Forum|alt.badge.img+24
In fact Custom Data rules are perfect for your situation as they do work for Grid Edit or any other method like Importing from excel or API calls, and of course regular forms entry.

The formula would be 



IF(Round([Hours],0.1) < [Hours],"Hours can only be entered in whole numbers or tenths of an hour")

It's possible that there could be some weird rounding errors so this might be safer.

IF(Round([Hours],0.1) < Round([Hours],0.0001), "Hours can only be entered in whole numbers or tenths of an hour")





------------------------------
Mark Shnier (YQC)
Quick Base Solution Provider
Your Quick Base Coach
http://QuickBaseCoach.com
mark.shnier@gmail.com
------------------------------