How do I force a user to ONLY enter up to 2 decimal places?

  • 0
  • 1
  • Question
  • Updated 4 years ago
  • Answered

We have products with unit costs with 4 decimal places but want our sales reps to quote unit price to only 2 decimal places.  Sometimes they forget and use more decimal places and this throws the quote out as it only shows in 2 decimal places which are rounded up.


Photo of Michael Graham | Insight Global UK

Posted 4 years ago

  • 0
  • 1
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 65,806 Points 50k badge 2x thumb
Try this

Make a formula-text field called [Warning on too many decimals] like this

IF(Abs([price]-Round([price],0.01))>=0.001,"Too many decimals").  Put that field on the form near the price field and hide the label.


Then make a form rule that says

When the record is saved

and [warning on too many decimals is not equal to (blank)

abort the save with message "Too many decimals.  Correct the decimals to two places and tab out of the field  and then try saving again"


(note that like Excel, QuickBase does not see the input or the corrected input until the user tabs out of the field.  That can be confusing to users as they may fix the price, and then keep trying unsuccessfully to Save. Try it and you will see what I mean.
oh that's just so good.  Thanks Mark!
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,064 Points 20k badge 2x thumb
HTML5 Form With Input With Pattern - Add New Record
https://haversineconsulting.quickbase.com/db/bj25hj6wv?a=nwr

Pastie Databsase
https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=398

Mnookin: "On Average We Have Two Answers To Every Question"
https://www.youtube.com/watch?v=9uR_t-6iTJk&feature=youtu.be&t=3m50s

How dichotomous! Native v Script, Yin v Yang, Geometric v Algebraic

@Mark - My analogy so I ascribed you Yin and I claimed Yang

 http://www.differencebetween.net/miscellaneous/difference-between-yin-and-yang/
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 65,806 Points 50k badge 2x thumb
Thx Dan, I'm good with being Yin to your Yang.