Let’s talk Alteryx Copilot. Join the live AMA event to connect with the Alteryx team, ask questions, and hear how others are exploring what Copilot can do. Have Copilot questions? Ask here!
Start Free Trial

Alteryx Designer Desktop Discussions

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

Insert comma to numbers which are string as input

ferha_jafri
8 - Asteroid

Hello Experts,

 

I have a query in which I want to insert commas to string represented as $1200 and output as $1,200. So the requirement is like I want $ as well and want to convert the numbers to integer.

 

Thanks in advance

1 REPLY 1
OllieClarke
16 - Nebula
16 - Nebula

Hey @ferha_jafri 

You can use the ToString() function to specify decimal places and also whether you want a thousands separator.

So in this case, we can remove the '$', convert the string to a number, then convert it back to a string with 0 decimal places and a thousands separator, and then re-add the '$' or:

'$'+
Tostring(
ToNumber(
REPLACE([Field1],'$','')
),0,1)

OllieClarke_0-1622550942670.png

 

Hope that helps,

 

Ollie

 

Labels
Top Solution Authors