In case you missed the announcement: Alteryx One is here, and so is the Spring Release! Learn more about these new and exciting releases here!

Alteryx Designer Desktop Discussions

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

How can I format a number to use 1000 separator (,) and 0 decimal places

Marcegon
8 - Asteroid

Hi, I am trying to format the number below with a comma separator and round up with 0 decimal places (see below). 

Also, I want to align the number to the right.  Any help would greatly appreciated!

 

Input

29722.86

 

Output

29,723

 

Thank you. 

3 REPLIES 3
DataNath
17 - Castor
17 - Castor

@Marcegon in doing this you’d need to use the ToString() function with the thousand separators argument set to 1 (=Yes). Unfortunately, in doing so, you’ll lose the numeric data type but this is the only way currently. In terms of aligning to the right, this is something you’d need to do in a Table tool, where you can click on a field and set its alignment. When outputting the table tool you’d then need a Render tool instead of a standard Output Data tool.

 

DataNath_0-1664479873506.png

 

Edit: I hadn't previously realised that the Table tool will automatically format numbers with thousand separators and so you can just plug your number straight into it and set the decimals to 0:

 

DataNath_0-1664539824046.pngDataNath_1-1664539830725.png

gyang3
Alteryx Alumni (Retired)

Hey @Marcegon I've attached a simple workflow for this. Let me know if this helps.

 

gyang3_0-1664473496287.png

 

Garabujo7
Alteryx
Alteryx

Hello @Marcegon ,

 

You could use the Table tool to align to the right

 

Garabujo7_0-1664473441013.png

 

 

Gabriel

Labels
Top Solution Authors