In a column set to type Decimal, with 2 decim

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!

Solved Solved
0 8 746
1 ACCEPTED SOLUTION

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.

View solution in original post

8 REPLIES 8

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

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.

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

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.

+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?

Documentation is lacking, but (coincidentally) Iโ€™m working on it.

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.

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

Top Labels in this Space