We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Rounding number

noopurjain
8 - Asteroid

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!

6 REPLIES 6
alexnajm
18 - Pollux
18 - Pollux

Round function should work! Have you tried it yet?

alexnajm
18 - Pollux
18 - Pollux

Round([Value], 0.01)

nagakavyasri
12 - Quasar

@noopurjain Try round function with the data type as Float/Double

 

Screenshot 2024-11-06 120803.png

WesHarden
6 - Meteoroid

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.

WesHarden
6 - Meteoroid

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.

KGT
13 - Pulsar

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.

Labels
Top Solution Authors