In a column set to type Decimal, with 2 decim

(Dâmaso Saraiva) #1

In a column set to type Decimal, with 2 decimal places, a formula that boils down to CONTAINS(2018.52,2018.5) is evaluating to TRUE.

Expected behaviour would be FALSE, as 2018.52 and 2018.5 are two different decimal numbers.

Workaround or fix?

Cheers!

(Bellave Jayaram) #2

Why do you need CONTAINS - can’t you just use [Col1]=[Col2]?

(Dâmaso Saraiva) #3

nope, the formula parses a list of values and looks for a specific value in that list. the above is just a simplification of a case that is returning true and it shouldn’t.

(Dâmaso Saraiva) #4

I worked around it by using IN() instead of CONTAINS(). Still, it appears CONTAINS() is bugged and does not currently support decimals.

(Steven Coile) #5

CONTAINS() is a text function and converts its arguments to text if not already so. “2018.52” does, in fact, “contain” “2018.5” in that it is the first 6 characters of the other. CONTAINS() is not equality.

(Dâmaso Saraiva) #6

+Steve Coile Interesting. Is there an article on the CONTAINS() function explaining this? Doesn’t seem to be one in the support site.

Also, to parse a list of numbers and check whether it contains something, would you use IN() as well or something else?

(Steven Coile) #7

Documentation is lacking, but (coincidentally) I’m working on it. :slight_smile:

(Steven Coile) #8

IN() is your best choice to find whether a value is occurs within a list. Unfortunately, your options for checking whether a particular substring occurs within another string are limited.

(Dâmaso Saraiva) #9

+Steve Coile Cheers. A support article on IN() would also be nice.