Alert: There is a planned Community maintenance outage October 16th from approximately 10 - 11 PM PST. During this time the Alteryx Community will be inaccessible. Thank you for your understanding!

Alteryx Designer Desktop Discussions

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

Fixed decimal assigned in a formula

aka_ash
8 - Asteroid

Hi,

 

I am trying to solve an issue regarding values that are required to be converted to a fixed decimal (20.5) which i have not had issues with however I have scenario where I have and IF statement that is required to output the Fixed Decimal or a String value, as there is a conflict of data types i can not get the fixed decimal value as it reverts back to the original value (non 5 decimal places) if I change it to string to accommodate the string value

Is there a way to convert a value to a Fixed decimal using a formula instead of data type selection?

 

I have attached an example with an expected output column

 

Thanks in advance,

Ash

2 REPLIES 2
fmvizcaino
17 - Castor
17 - Castor

Hi @aka_ash ,

 

To accomplish that, you can use the ToString function where you can define the number of decimal numbers you want in your output.

 

ToString(x, numDec, addThousandsSeparator, decimalSeparator): Converts a numeric parameter to a string using numDec decimal places. By default, the period is used as the decimal separator.

 

Best,

Fernando Vizcaino

aka_ash
8 - Asteroid

Thank you very much for this @fmvizcaino.

This is exactly what i was looking for.

 

Cheers,

Ash

Labels