Start Free Trial

Alteryx Designer Desktop Discussions

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

Double Type for number cell

Lvworking
5 - Atom

Hello 

 

I am cleaning a dataset and there are a few currency fields and a percent field in decimal form. I want to restrict the number of characters after the decimal to only 2. On the currency fields, I want to format as currency with commas, which are currently missing. I think I need to achieve this by using a formula but I can't pinpoint which formula I should use to achieve the 2 goals. I keep receiving error messages. I've included a sample of the data below. The first column is a currency field that needs currency formatting, commas. The fifth column is percent in decimal format but I want no more than 3 characters after a decimal. Both columns were assigned as Double for the type. 

 

Thank you, in advance, for your comments and advice. 

 

Lvworking_0-1755802830582.png

 

4 REPLIES 4
binu_acs
21 - Polaris

@Lvworking one way of doing this, when you add a "," to the amount, the data type should change to vstring

binuacs_1-1755803564656.png

 

Lvworking
5 - Atom

When I went to make the changes to type, I noticed my types were off. The percentage column was set to V_WString and the currency column was set to double. When I changed the percentage column to double, it automatically rounded to 2 spaces after the decimal. I was going to do 3 but 2 works just as fine so I left that column. 

I changed the currency column to V_WString and applied the ToString formula but it remains unchanged (see below). I feel like I am overlooking something simple. 

 

Lvworking_0-1755805046401.png

 

binu_acs
21 - Polaris

@Lvworking The Tax_Due field is string type, thats why the toSTring() function is not working for you, to work that apply toNumber() function like below 

 

binuacs_0-1755806719715.png

 

Lvworking
5 - Atom

Ok that makes perfect sense! That worked and now I know the formulas do not treat all string types the same. I really appreciate your assistance and quick responses!

Labels
Top Solution Authors