Compare two dates and choose the closest value to zero

I just compare Date&time difference two dates and I just find out how to get closest value to zero.
e.g.
I have 4, and -243 so give me 4

You can do this with a Math Formula node:

if (abs($value1$) < abs($value2$), $value1$, $value2$)

Here’s an example:

https://nodepit.com/workflow/com.nodepit.space%2Fqqilihq%2Fpublic%2Fforum%2Fcompare-two-dates-and-choose-the-closest-value-to-zero-21726.knwf

– Philipp

2 Likes

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.