Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Rounding difference between versions

OllieClarke
15 - Aurora
15 - Aurora

Hey gang, @DataNath and I've got a weird one here:

 

So If I have the number 4.655665 and I try and round it to 5 dp, I get 4.65665 (using ROUND([value],0.00001)

If I try and round it using ROUND([value],0.000010) then in version 2022.1 I get 4.65665, but in version 2020.3 and 2021.4 I get 4.65567

 

2022.1:

OllieClarke_0-1669300758897.png

2020.3:

OllieClarke_1-1669300795988.png

 

Also, when I round to 4 decimal places using a similar number (4.65665) then there is no difference between adding the extra 0 at the end or not. No matter the version or the formula I get 4.6567

 

In my head there shouldn't be any difference between rounding to 0.00001 and 0.000010, but I would also assume ...665 would get rounded to ...67 

 

I know there can be weirdness with floating point arithmetic and by adding a tiny increment you can force it, but I'm surprised by the differences between versions.

 

Any idea what's going on here?

 

Ollie

5 REPLIES 5
DataNath
17 - Castor

For a little extra context, this was the post that started the discussion - looks like various users faced the same rounding difference issues:

 

https://community.alteryx.com/t5/Alteryx-Designer-Discussions/Round-to-5-decimal-places/m-p/1037882#...

OllieClarke
15 - Aurora
15 - Aurora

@BenMoss you know things. Any idea what's happening?

apathetichell
18 - Pollux

@OllieClarke-  I'll check this out in 2022.1 later today - but does the same behavior occur with fixed decimals? My assumption would be something like Alteryx is using a fractional representation for the double which is less accurate and is showing the rounding issue.  Someone else more knowledgeable than me would have to explain why different versions would store numbers differently.

 

OllieClarke
15 - Aurora
15 - Aurora

@apathetichell I could be wrong, but I think that numbers are treated as doubles no matter their data type when in calculations. In the way that all dates are treated as datetimes in calcs.

 

I'm just surprised that rounding would change between versions 😕

apathetichell
18 - Pollux

Me too - my tests confirmed no difference between numeric types on 2022.1

Labels