Free Support Forum -

Decimal Validation

I need to validate a field to take only decimal values as input for which i am using ValidationType.Decimal.

The problem is that it is also accepting commas, and $ and % characters at the end of the entered value.

I only need decimal values to be entered and nothing else.

How can I create a custom validation like that??


You can specify ValidationType.WholeNumber.

Validation.WholeNumber won't take decimal values like 10.2.

Also it is allowing for $ in the begining of a number.

ValidationType.WholeNumber accepts number starting with $ but it won't take 10.2.

Frankly speaking, I don't know how to make it to suit your need. Do you know how to make it manually in MS Excel? If yes, I may find a way to make it with code.

This kind of a validation can be achieved through Macros, and I don't really know how to implement macros here.

What is CustomValidation? Can we not have a custom validation for such a requirement?


Custom validation is not supported yet. I don’t know how to make it to serve your need.

Is there anything like RegularExpressions?

I think MS Excel doesn’t support such a feature.