Reputation: 6622
I have a decimal field which should allow only quarter values: 1.0, 1.25, 1.5, 1.75, but not values like 1.33 or 1.78. How can I validate this?
Upvotes: 0
Views: 236
Reputation: 6015
To match such number use regex
pattern
(?!0\d)\d+(?:[.](?:25|5|75|0)0*)?(?!\d)
Hope this regex could help
Upvotes: 2