Hello,
I need help with rounding numbers. I have values in the input column that I need to convert to the corresponding values in the output column. I'm unsure which function to use.
Input Output
71.93999863 → 71.94
78.49799919 → 78.5
Thanks for your help!
Solved! Go to Solution.
Round function should work! Have you tried it yet?
Round([Value], 0.01)
This is weird. I did the rounding function. When I summed the data following, the rounding did not work in the sum. However, when I joined the field using a join, it recognized the rounding in the join and accepted the fields as matching (even though 100k records have miniscule fractions of a penny difference) example 12.4999998 to 12.5000002. FYI, I am comparing data output from alteryx to a previous data source exported to excel.
By the way, the rounding formula changed the display, but when I sum the data, the round formula didn't work. I tried both double and float formats. However, when I changed to a fixed decimal format after the round, that worked.
Just to clarify, so as you don't go down a rabbit hole. This statement "the round formula didn't work", is jumping to a conclusion. It will have worked, however the display may be off. When looking at the data, as close to the datasource/rules as you are, you are seeing a representation of that data.
A double uses 64 bits to represent a umber with greater precision, but the way that it is represented on disk in 64-bits (53 used for precision) means that 5.1 may be stored as 5.0999999... which is the same number, but different representation. This is the reason for warnings on joining double to anything else, or group by on double etc.
The key here is to be sure about what you are comparing. As the data is previously exported to excel and has many decimals, I would always make sure of it on the re-entry as Excel can do some weird rounding things as well with the way it stores the number as a string in it's XML and then represents it as a number for the display.
User | Count |
---|---|
61 | |
24 | |
23 | |
21 | |
20 |