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:
2020.3:
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
For a little extra context, this was the post that started the discussion - looks like various users faced the same rounding difference issues:
@BenMoss you know things. Any idea what's happening?
@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.
@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 😕
Me too - my tests confirmed no difference between numeric types on 2022.1