Rounding Issue?

Wondering if anyone has run into this sort of issue before? Some of our invoices are getting caught in the Report Warnings step due to variance, but the message says the variance is 0.00! I print out the _totalHdrMiscAmt that the workflow compares to the InvoiceAmt field and it gives me the sum with an extra “1” in the decimal. Thinking this occurs when there are lots of lines, but also have not run into an issue like this until yesterday. Has this happened to anyone else? I tried a little bit yesterday to round to 2 decimal places, but will continue to try today. Just wanted to see if anyone else was having this problem?

image

The “99.7500000000001” is the value being compared to InvoiceAmt

1 Like

This is actually a function of SQL server and the way it stores decimals. Let me see if I can find an article on it.

I’ve not seen it in ECM, but I assume you’ll need to alter your calculation to include at least a 5-decimal rounding function to get by it.

1 Like

This thread has some good details on options for rounding workarounds as ECM unbelievably doesn’t have rounding as a feature.

The post by @swilliasc111 is a good workaround for this.

I would also add to what @MikeGross said as you could likely create a SQL datalink to round the values to the decimal places you dictate.

1 Like

Using the Advanced Format task to format _totalHdrMiscAmt as {0:n2} worked!! Thank you!

1 Like

Nice Matthew, it’s usually the timing of the rounding that bites people, but you got it and thank you @vleveris as always. You’ve been an incredible contributor to this group.

1 Like

Much appreciated, @utaylor; however, all credit for this solution has to go to my colleague @swilliasc111!

It really is a quick and elegant method for rounding values. To your point, though, it definitely comes down to timing of things, like many other aspects of ECM workflow development.

2 Likes