You are viewing limited content. For full access, please sign in.

Question

Question

workflow decimal rounding issue when checking less/greater than zero

asked on March 18, 2016

Found an issue in workflow. While trying to detect less/greater than 0 when working with decimal or currency tokens. Seems decimals are rounded. -.49 would be rounded to 0 and thus fail a less than 0 check. Likewise .49 fail a greater than check.

 

Confirmed on both Workflow 9.2.1 and 10.0.0

 

0 0

Replies

replied on March 21, 2016

Hello David, 

 

I tested the tokens and they were evaluated correctly for conditionals when set as a number or currency. Out of curiosity, what Token Tags were the tokens given?

0 0
replied on March 23, 2016

I went ahead and tested this further on workflow 10. Number token tag seems to work fine. Issue is with Currency token tag. Greater/less than check failure varies. Something weird going on.

Negative:

Leading zeros fails. -.39 succeeds whereas -0.39 fails.

Positive:

Leading zeros succeeds. .39 fails whereas 0.39 succeeds.

simple workflow test:

0 0
replied on March 25, 2016 Show version history

Hello David, 

 

You are correct about currency. It turns out that currency does not have it's own way to compare two currency tokens, so it defaults to comparing them as strings.

Would you be able to use number tokens since those do have their own way to compare numbers?

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.