Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

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

2 Decimal Places without Rounding

fikrizahari
8 - Asteroid

Hi,

Good day !

I would like to 'round down' numbers to 2 decimal places.
Example as below :

Field1   Correct Output  
30689.7130689.71
4300.2864300.28
6504.6616504.66
6074.7286074.72
467.1111467.11
2222.2492222.24
2277.222277.22
2273.72273.7
2277.222277.22

 


However, i could not find 'round down' formula in Alteryx, so I use 'floor' formula.
Formula for 'Round Down' column that i used, and the result as below :

fikrizahari_3-1678849339764.png

 


You can see there some different expected output on Round Down column ( Record 7 - 9 ).
Please advise what is the reason, or is there any better formula to get 2 decimal places without rounding it.

Thanks !

11 REPLIES 11
Yoshiro_Fujimori
15 - Aurora
15 - Aurora

@fikrizahari ,

As you see the explanation of the function

Yoshiro_Fujimori_0-1678947950737.png

If you input "0.05" as "mult" parameter, the function will find the "nearest multiple of 0.05".

So the nearest multiple of 1.21 would be 1.2, not 1.25.

 

In this case, you would need to shift the border by 0.025 (half of 0.05).

And also you need to shift a little bit to avoid the base conversion error.

With the formla below, 

Round([Field1] + 0.0249, 0.05)

The output would be

Yoshiro_Fujimori_1-1678948196084.png

 

reeteshchoudhury
7 - Meteor

Hi, There is a very simple way to achieve this without any complex formula: Just use the floor function with the following parameter:

 

floor([Data],0.01)

 

Data               Result
1555.848      1555.84
3441.202      3441.2
6115.357       6115.35
2411.07        2411.07
60128.39      60128.39

Labels
Top Solution Authors