Alteryx Designer Desktop Discussions

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

Bankers Rounding/ASTM Rounding

JHOL
5 - Atom

Hello, I'm trying to get a formula that will round numbers per ASTM rounding/bankers rounding.  This is also known as round half even.  I've seen some previous posts on this but never really saw a conclusive answer.  

 

For example: 2.65 would round to 2.6.

2.75 would round to 2.8

2.74 would round to 2.7

2.79 would round to 2.8

 

Thanks in advance!

7 REPLIES 7
TheOC
15 - Aurora
15 - Aurora

hey @JHOL 

 

You can use the round function in the formula tool to do this:
https://community.alteryx.com/t5/Alteryx-Designer-Knowledge-Base/How-To-Round-Numeric-Values-with-th...

You would just want to specify one decimal place.

Hope this helps,
TheOC


Bulien
JHOL
5 - Atom

The round tool does not allow you to specify this specific type of bankers rounding that I need. It would round 2.15 and 2.25 to 2.2 and 2.3 respectively. I need them to round to 2.2 and 2.2. 

fakbarli
5 - Atom

Any luck on this?

apathetichell
18 - Pollux

how many digits - for rounding to tenths you'd use- if mod(round([Field1],.1),2)=0 then round([Field1],.1) else round([Field1],.1)-.1 endif

 

you'd adjust depending on the digits you want. could this be dynamic - sure. But I'm lazy so I'll hand you that and you can use as you'd want.

apathetichell
18 - Pollux

deleted (duplicated)

aatalai
14 - Magnetar

@JHOL would 2.66 be 2.7 or 2.6?

apathetichell
18 - Pollux

@aatalai - depends on the round precision - tenths - that would be 2.6. To hundredth it would stay at 2.66. @fakbarli can use my formula and adjust for their rounding needs.

Labels