3 Replies Latest reply on Sep 7, 2015 2:14 AM by Ey Tan

# String of rounded figure showing more decimal places than formula

Hello all,

I need to show a percentage in string format.

I've used this:

str(round(([measure]),3)*100) + "%"

and this

str(round([measure]*100,1)) + "%"

in some cases I'm getting results like this

22.299999999999999%

How do I have it show 22.3% as a string?

Thanks a lot

• ###### 1. Re: String of rounded figure showing more decimal places than formula

Hi Ey,

This question was answered by both me and Simon about a month ago, it does need a new calc specifically to correctly handle the rounding:

Decimal places

Conditional Formatting number

Steve

1 of 1 people found this helpful
• ###### 2. Re: String of rounded figure showing more decimal places than formula

I've included AVG to the number before I round it off and it's still not showing as intended.

the column 'Result' shows the data per the input file. (multiplying that by 100 gives the percentage it is supposed to show)

I've got no idea where those series of 9s and 0s in the 2nd to 4th columns came from ..... I got error msgs saying "content of this type is not allowed" when uploading my dummy excel file and TWBX.

The formulas I used for the above are:

1. str(round(([Result]),3)*100) + "%"
2. str(round(AVG([Result]),3)*100) + "%"
3. str(round(([Result])*100,3)) + "%"

Any ideas to possibilities I could explore are much appreciated!

• ###### 3. Re: String of rounded figure showing more decimal places than formula

thank you. I've used MAX() as mentioned in the link and it worked for me:

str(round(MAX([Result])*100,1)) + "%"

2 of 2 people found this helpful