Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

Round to 5 decimal places

Paddi
8 - Asteroid

Hi all,

 

I'm currently working on an issue to round the data to 5 decimal places. It is simple in excel, but I'm wondering how can it be done by alteryx.

The sample data has been attached. 

 

Thank you so much.

 

Paddi_0-1669173013926.png

 

14 REPLIES 14
Fangfang
6 - Meteoroid

  hi DataNath, thanks seems easy and clean, but may i also ask to keep 0 if decimals shorter than 5? such like 4.35  to 4.35000?

ShankerV
17 - Castor

hi @Fangfang 

 

Hope you have checked my solution to overcome the issue of 0 at end.

 

PadRight(tostring([Out1]),7,'0')

 

Many thanks

Shanker V

DataNath
17 - Castor
17 - Castor

@Fangfang sure, in my previous output I had the output data type as a double. If you just change it to fixed decimal with a scale of 5, it'll automatically populate the extra trailing zeros without any change to the expression needed:

 

DataNath_0-1669199358173.png

Fangfang
6 - Meteoroid

hi DataNath,

sorry failed from my side. 

 

Fangfang_0-1669261096884.png

 

Fangfang
6 - Meteoroid

hi ShankerV, thank you for your kindly help, but your solution seems a little more complex to me. My original workflow had been too long and too many tool, this is a part of it. So i would like to use an easy way to deal it now.  But I will study careful about yours later. Thank you so much again. 

Labels