function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ 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