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
15 - Aurora
15 - Aurora

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