Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

Rounding bug when using Round function?

timothyyeo
7 - Meteor

Hi All,

 

I'm trying to do a simple rounding to 2 decimal places. My formula is provided below. 

clipboard_image_1.png

 

In general, the results turn out as expected, however, for the values below, it seems the algorithm is erroneous. The result I was expecting for Amount_2DecPlc is -0.01. However, The Round() function returns 0 instead. Can anyone explain why this is so, and what I can do to ensure that  -0.005 will round to -0.01?

 

clipboard_image_0.png

 

Thanks in advance.

Rgds,

Timothy

2 REPLIES 2
MichalM
Alteryx
Alteryx

@timothyyeo 

 

The function seems to require an indication that this is a negative value. If you use the below, it should fix it.

 

IF [Value] < 0 THEN Round([Value], -0.01)
ELSE Round([Value], 0.01)
ENDIF
timothyyeo
7 - Meteor

Thanks @MichalM, its working correctly now. 

Labels