# List.contains not working

**URL:** <https://forum.dynamobim.com/t/list-contains-not-working/25560>\
**Category:** Lists-Logic\
**Created:** [September 5, 2018, 7:07am UTC](https://forum.dynamobim.com/t/list-contains-not-working/25560 "2018-09-05T07:07:51Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![ROY](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/roy/32/55244_2.png) [@ROY](https://forum.dynamobim.com/u/ROY)\
**Post date:** [September 5, 2018, 7:07am UTC](https://forum.dynamobim.com/t/list-contains-not-working/25560/1 "2018-09-05T07:07:51Z")

</div>

hello,

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/7/7/77dcbaaabe67a2e203d5ed4c3eb31f788548763c.png)  
I got two issues one of them which is marked in red, all X vector has 0 value but when I’m collecting values it is showing some super precised value. That i don’t understand why its working like this.  
Another issue is which is in blue, I’m trying to generate boolean mask for values containing 0 but its not working.  
Where am i doing wrong? please help.  
Thanks.

---

<div class="post-metadata">

**Author:** ![Jonathan.Olesen](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jonathan.olesen/32/44242_2.png) [@Jonathan.Olesen](https://forum.dynamobim.com/u/Jonathan.Olesen)\
**Post date:** [September 5, 2018, 7:17am UTC](https://forum.dynamobim.com/t/list-contains-not-working/25560/2 "2018-09-05T07:17:53Z")

</div>

Because you’re asking if the string contains the number 0, try writing “0” instead 😉

---

<div class="post-metadata">

**Author:** ![ROY](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/roy/32/55244_2.png) [@ROY](https://forum.dynamobim.com/u/ROY)\
**Post date:** [September 5, 2018, 7:19am UTC](https://forum.dynamobim.com/t/list-contains-not-working/25560/3 "2018-09-05T07:19:26Z")

</div>

I tried this not working. 😕

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/4/7/471f004da88e814b274c15a1375ff7fee649ad60.png)

Neither ths working

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/a/6aa1cd19bc74dbb519066ea759792ec3022a346a.png)

---

<div class="post-metadata">

**Author:** ![Jonathan.Olesen](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jonathan.olesen/32/44242_2.png) [@Jonathan.Olesen](https://forum.dynamobim.com/u/Jonathan.Olesen)\
**Post date:** [September 5, 2018, 7:28am UTC](https://forum.dynamobim.com/t/list-contains-not-working/25560/4 "2018-09-05T07:28:00Z")

</div>

In the first screenshot please show the preview under the “string from object” node…

In the second you’re comparing a “integer” with a “double” (try to use the “Object.Type” node to make sure you’re working in the right data type) 🙂

---

<div class="post-metadata">

**Author:** ![ROY](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/roy/32/55244_2.png) [@ROY](https://forum.dynamobim.com/u/ROY)\
**Post date:** [September 5, 2018, 7:30am UTC](https://forum.dynamobim.com/t/list-contains-not-working/25560/5 "2018-09-05T07:30:46Z")

</div>

![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/7/6/76571f0797aac9b50f046c17947a63b663de0796.png)  
i was trying to filter out all -1,0,1  
now this is what i’m getting.

---

<div class="post-metadata">

**Author:** ![ROY](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/roy/32/55244_2.png) [@ROY](https://forum.dynamobim.com/u/ROY)\
**Post date:** [September 5, 2018, 7:32am UTC](https://forum.dynamobim.com/t/list-contains-not-working/25560/6 "2018-09-05T07:32:16Z")

</div>

i got the reason behind is all values are have .000000 thats why its behaving like this.  
So what is the correct direction for filter out 0 and 1?

---

<div class="post-metadata">

**Author:** ![mellouze](https://avatars.discourse-cdn.com/v4/letter/m/e47774/32.png) [@mellouze](https://forum.dynamobim.com/u/mellouze)\
**Post date:** [September 5, 2018, 7:32am UTC](https://forum.dynamobim.com/t/list-contains-not-working/25560/7 "2018-09-05T07:32:47Z")

</div>

Hi @ROY,

As @Jonathan.Olesen said, you are simply not comparing the same type of data 🙂 Please see below.

 ![77dcbaaabe67a2e203d5ed4c3eb31f788548763c](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/5/3/53095631edbcf25f62a54ff1b200e9dc47e4cf07.png)

---

<div class="post-metadata">

**Author:** ![Jonathan.Olesen](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jonathan.olesen/32/44242_2.png) [@Jonathan.Olesen](https://forum.dynamobim.com/u/Jonathan.Olesen)\
**Post date:** [September 5, 2018, 7:35am UTC](https://forum.dynamobim.com/t/list-contains-not-working/25560/8 "2018-09-05T07:35:10Z")

</div>

![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/5/6/56c4608efd1985d1c06316b6cb552b91b9f8e713.png)

You could if you want integers either floor or ceiling the numbers…

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/3/6/36b64a10a0293407629e99cc231245bf8b5f5a9e.png)

---

<div class="post-metadata">

**Author:** ![ROY](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/roy/32/55244_2.png) [@ROY](https://forum.dynamobim.com/u/ROY)\
**Post date:** [September 5, 2018, 7:35am UTC](https://forum.dynamobim.com/t/list-contains-not-working/25560/9 "2018-09-05T07:35:49Z")

</div>

![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/c/4/c44b7c8ee35142e192d7dae74bbaabb36314c25f.png)  
not working.

---

<div class="post-metadata">

**Author:** ![ROY](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/roy/32/55244_2.png) [@ROY](https://forum.dynamobim.com/u/ROY)\
**Post date:** [September 5, 2018, 7:38am UTC](https://forum.dynamobim.com/t/list-contains-not-working/25560/10 "2018-09-05T07:38:00Z")

</div>

thanks @Jonathan.Olesen. Now i understand.

---

<div class="post-metadata">

**Author:** ![Jack](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jack/32/44338_2.png) [@Jack](https://forum.dynamobim.com/u/Jack)\
**Post date:** [May 20, 2023, 12:51am UTC](https://forum.dynamobim.com/t/list-contains-not-working/25560/11 "2023-05-20T00:51:01Z")

</div>

I’m stuck on a similar issue. Trying to filter out items with a vector of -1 or 1.

I’ve tried this with strings & numbers and I can only ever get one of the list.contains to produce a ‘true’.  
I have used both == and list.contains nodes.

Any ideas?

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/2/b/2b7d464af6b959a5859a42c3d7587eaa74f1d70c.png)

---

<div class="post-metadata">

**Author:** ![christian.stan](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/christian.stan/32/166296_2.png) [@christian.stan](https://forum.dynamobim.com/u/christian.stan)\
**Post date:** [May 20, 2023, 6:40am UTC](https://forum.dynamobim.com/t/list-contains-not-working/25560/12 "2023-05-20T06:40:54Z")

</div>

Good morning, at the output of your math.round node try this code in a code block

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/b/2/b22348acd89e51a8e2c30e62923894d5667edd44.png)

`x>0||x<0?true:false;`  
edit: There is a solution 4 posts above  
Cordially  
christian.stan
