Number field comparison doesn't work for value of 0
Closed this issue · 1 comments
What happened?
I have a Project with a Number field "priority". In a Board view I tried to apply a color filter that checks that "priority" <= 0. It did not apply the color to any of my notes with "priority" = 0. I tried other comparisons to see if I could get those notes to be colored.
Comparisons that did apply color to notes with priority 0 as expected were:
- priority == 0
- priority != 1
Comparisons that did not apply color to notes with priority 0 were:
- priority <= 0
- priority >= 0
- priority < 1
- priority > -1
Comparisons mostly worked as expected for notes with nonzero priority, except when comparing to 0.
What did you expect to happen?
I expected notes with priority 0 to be colored when applying these comparisons:
- priority <= 0
- priority >= 0
- priority < 1
- priority > -1
I expected notes with nonzero priority to be colored when checking for priority greater than or less than 0.
How can we reproduce it (as minimally and precisely as possible)?
- Create new project
- Add a new note to the project
- Add a Number field (e.g. "priority") to the new note, with a value of 0
- Add a color for the current view of the project, with the condition
priority >= 0
- Observe that the note is not colored
Anything else we need to know?
No response
Plugin version
1.17.1
Obsidian version
1.5.8
OS
Windows