We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Can't convert numerical field to currency

bradtukey
7 - Meteor

my field Total Opp Amount is a float type, and I'm using the formula below but getting an error. I have double checked that field exists in the dataset and the field name is spelled correctly, and that it is a float type field. 

 

ToString([Total Opp Amount], "$0,000.00")

 

The error is Parse Error at char(1): Invalid type in ToDouble () (Expression #1)

 

I'm not using the ToDouble function so I don't understand this error or how to fix it. I've also tried converting the field to a Double type.

4 REPLIES 4
caltang
17 - Castor
17 - Castor

Can you screenshot the whole formula tool and its expressions? 

 

Also - why Float? Double is better in this case.

Calvin Tang
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
usmanbashir
11 - Bolide

@bradtukey - Try using below:

'$' + ToString([Total Opp Amount], 2, 1)

 

"$0,000.00" is not valid to be used in the ToString() Function

- View this Alteryx documentation on Conversion Functions - https://help.alteryx.com/current/en/designer/functions/conversion-functions.html#idm45832346081648 . ToString() is at the very bottom.

 

Hope this helps!

bradtukey
7 - Meteor

Thank you, that worked, but only if I first converted the field to V-String. When I ran your formula with the field as "double" I got an error that said the field has to be a string. converting the field back to numerical after adding the "$" resulted in Null values in the field. What I'm trying to accomplish is to export my table to Excel, and when I open the workbook, have the field already formatted as currency. 

jdminton
13 - Pulsar

For this, you'll need to use the reporting tools. A table and render tool will do this. Alternatively, you can export to an Excel sheet for "data" and use formulas to read and format the data in another tab if you want to avoid the reporting tools. 

Labels
Top Solution Authors