+ Start a Discussion
gvgv 

Validation rule for a float value

Hi,

 

I have a 2 text  fields which accepts numbers. I need to validate to make sure it does not anything other than the following:

 

1. 0-9

2. +,-

3 .(period)

 

Basically validate for a float value. I checked in the help topics. could not find any function. How or which function should I ue

 

Thanks in Advance

 

Best Answer chosen by Admin (Salesforce Developers) 
CaptainObviousCaptainObvious

Try this:

 

 

NOT(REGEX(Custom_Field__c ,"^[-+]?\\d+(\\.\\d+)?$"))

 

 

 

All Answers

CaptainObviousCaptainObvious

Try this:

 

 

NOT(REGEX(Custom_Field__c ,"^[-+]?\\d+(\\.\\d+)?$"))

 

 

 

This was selected as the best answer
gvgv
Thanks Captain. That worked