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
bensondanielbensondaniel 

Float ending with .00

Hi guys,

 

I want to check if a given float number e.g (12.30) is a whole number

 

In this case 12.30 is not a whole number but 12.00 is.

 

If it is not a whole number like 12.10 or something like that I want to fire the validation.

 

Please help!

Thanks in advance

jungleeejungleee

I think the below condition should help..

 

NOT(CONTAINS(TEXT(your_number_field__c), ".00"))

 

Regards

Sam

bensondanielbensondaniel

Hi there,

 

I would have thought so. Your logic seems very right, but Salesforce is not accepting it. Its not working.

Thankyou very much for teying but can you suggest me another solution?

jungleeejungleee

Hi ,

 

I am extremely sorry about the earlier formula. Anyways I just tested the below formula in the validation rule and this seems to be working.

 

CONTAINS(RIGHT(TEXT(yourNumberField__c ), 3), ".")

 

 

In the earlier formula NOT(CONTAINS(TEXT(Number_Here_I_come__c ), ".00")), if the entered number is 2.12 then ideally a validation error should come up, but I used the same formula, RIGHT(TEXT(yourNumberField__c ), 3), "."), in a formula field to check as to what value is veing calculated, I found something that surprised me. If the entered number is 2.00 in the number field, then the value being captured in the formula field was just 2 and not .00

 

Hope this helps!!

 

Thanks

Sam

 

bensondanielbensondaniel

Hi Sam,

 

this is what I tried

 

NOT(CONTAINS(RIGHT(TEXT(my_number_field__c), 3), ".00"))

 

not working :( But what you are trying completely makes sense. I have been trying so manhy combinations since yesterday and not able to achieve a result.

I am really appreciative of you trying!