Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Round a number

bh1789
8 - Asteroid

if the below data is coming through as V-WString:

 

0.19741

 

How would I round it to a number of 20%?

 

 

Thank you

 

7 REPLIES 7
alexnajm
18 - Pollux
18 - Pollux

Round(ToNumber([Data])*100, 1)

 

if you want to show the percent sign, you’d have to force it back to string using ToString and adding the “%” at the end!

binuacs
21 - Polaris

@bh1789 one way of doing this, note that  you cannot make it numeric format because % is string type, so when you add % the data should be in string data type

image.png

bh1789
8 - Asteroid

Thank you very much!  Your solution gave me what I needed from metric, to rounding to percent

bh1789
8 - Asteroid

[numerator]/[denominator]*100 gave me 4.4444444 (numerator was 56 and denominator was 1260)

Round(ToNumber([Metric])*100,1) gave me 444

ToString([Round], 2) + '%' gave me 444%

 

How would I get 4.44%?

alexnajm
18 - Pollux
18 - Pollux

You are multiplying the Metric by 100 in your second statement...

alexnajm
18 - Pollux
18 - Pollux

And you are rounding to the nearest whole number - correct both and you should be fine

bh1789
8 - Asteroid

That worked.  Thank you again!

Labels
Top Solution Authors