Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
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