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.
SOLVED

Insert Thousand Separator with Formula tool

jboschee
8 - Asteroid

Hi everyone,

 

I'm trying to add a thousand separator in the formula tool where my exchange rate calculation is.  Is this possible?

 

Thanks!

5 REPLIES 5
Hugo
9 - Comet

Hi jboschee,

 

I dont think this is available if you want to keep the field as a number - however if you are OK with changing the field to a string, you can use the ToString() function

 

TOSTRING(x, numDec, addCommas)Converts a numeric parameter to a string using [numDec] decimal places. There is also a third parameter to return the appropriate comma.

Optional Parameters:

addCommas: 0 or false (default) means format the numeric string without commas; 1 or true means format with commas.

Example

TOSTRING(10, 0) returns "10" as a text string

TOSTRING(10.2, 2)returns "10.20" as a text string

TOSTRING(1000.2, 2, 1)returns "1,000.20" as a text string

jboschee
8 - Asteroid

Thanks Hugo!  That worked great.

Gavinxiao
5 - Atom

Hi Hugo,

 

do you have any idea why did i get below error message:

the formula"XXX" resulted in a string but the field is numeric. Use ToNumber(...)if this is correct.(Expression#1)

 

and the formula i put is : ToString([NET],2,1)

 

i have been searching a answer for a whole afternoon now..........

ups366
8 - Asteroid

@Gavinxiao , Hi !

 

If you typed formula ToString([NET],2,1) in field [Result], because the ToString return a string, so your data type of  field [Result] must be like "V_WString", may be you used a error type like "Double" now.

GT1
5 - Atom

I am unable to get the tostring formula to work when trying to insert a comma in my count.  The following error occurs.  Please advise.

 

The formula "count" resulted in a string but the field is numeric

Labels