In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests after December 31, 2025. Set up your security questions now so you can recover your account anytime, just log out and back in to get started. Learn more here
Start Free Trial

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 Alumni (Retired)

@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
Top Solution Authors