Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

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

Round to 2 decimals with a comma as separator in numeric field

Hakimipous
10 - Fireball

Hello,

 

I was wondering what would be the best way to round Numbers rounded to 2 decimals with a comma as separator.

 

I've tried several combination

 

For Example I have here is what I have, and the output I need

 

Totaloutput
-69.180000000000007-69,18
588.95000000000005588,95

 

To round to 2 Decimals, I change the data type to FixedDacimal (19.2), but then I can't replace the ". "with a ","

Even if I use the formula ToNumber(REGEX_Replace(ToString([Year],2), ".", ",")) it outputs me .00

 as a decimal everywhere.

 

I tried also to check the "Use comma as decimal separator" in the select tool but it just output me a Null Value where I had decimals before

 

One way I found is in 3 step (without changinf the data types)

 

- ToString(ToNumber([Year]), 2,1)

 

- ReplaceChar([Year], ",", "")

 

- ReplaceChar([Year], ".", ",")

 

But I guess there is a much better way to deal with this ? 

 

Thanks!

3 REPLIES 3
MarqueeCrew
20 - Arcturus
20 - Arcturus

toString([your number],2,0,”,”)

 

will return 1234,45

 

replacing the 0 with a 1 gets you

 

1.234.45

 

my quote symbols may be wrong because of my phone. 

 

Cheers,

 

mark

 

 

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
Hakimipous
10 - Fireball

Thanks for the reply @MarqueeCrew

 

But it doesn't rounds my numbers to 2 decimals, or at least not all of them 

Hakimipous
10 - Fireball

Actually it's not an issue anymore. I found out that when I output to excel, I'll get the commas, even if Alteryx shows a dot as decimals separator  (If I change the data type to Double before that)

 

Thanks @MarqueeCrew !

Labels
Top Solution Authors