You need to sign in to do that
Don't have an account?

validation rule for currency field with 2 decimal values
hello
i am trying to make a validation rule for a currency field with 2 decimal values so that it only enables the user to put .00 .25 .50 and .75, with any other value in the decimals i need it to trigger the erro message.
this is what i've got so far:
NOT(REGEX(TEXT( Gross_Pay__c ), "[0-9]+[.]{1}[25,50]{2}")) it works for 25 and other values but not for 50
i am trying to make a validation rule for a currency field with 2 decimal values so that it only enables the user to put .00 .25 .50 and .75, with any other value in the decimals i need it to trigger the erro message.
this is what i've got so far:
NOT(REGEX(TEXT( Gross_Pay__c ), "[0-9]+[.]{1}[25,50]{2}")) it works for 25 and other values but not for 50
This would divide your field by 0.25. For values including .00, .25, .50, .75 there should be no remainder.
NOT(REGEX(TEXT(Your_currency_field__c ), "(?!0\\d)\\d+(?:[.](?:25|5|75|0)0*)?(?!\\d)"))
Hope that this helps!
i am trying to make a validation rule for a text field with 2 decimal values just like 20/30,40/50 and only 0.
It should give error message if it is like 122/22 or 299/349.
Here i wrote a validation rule :
NOT(REGEX(Edited_Discount__c,"[0-9]+[/]{1}[0-9]{2}"))
It will Validate 20/30,40/50 but when i give value 0 it throws validation exception.
Please help me on this .
Thanks
Lisa