Skip to main content

Hello! I am trying to use an input mask to allow for numerical entry only where the number has two decimal places.

 

For instance, we manufacture parts that have dimensions such as 68.50” and 82.25”. I tried using the input masks ##.##” and 90.99” on the attribute itself but when I enter the values above I get the following results:

68.50” → 68._5”

82.25” → 82._2”.

 

I had figured out that we could use something such as 90.99#” but it then returns values as:

 

82.25” → 82._25”

 

This isn’t ideal and could get confusing. Is there anyway to force a number right after the decimal?

Also, I believe I found a bug in the system when it comes to these input masks. Using the 90.99#” input mask above, it registers the number but every time I click on the attribute and click off it reduces the number and adds a space.

 

Thank you!

This regex (REGular EXpression) may suit your situation more:

/^(0||1-9]\d*)(\.\d+)?$/


Reply