Skip to main content

Hi,

 

I have been checking a lot of posts on this issue and none seem to work for my needs.

 

I have percentile bins created and i want to display a range on the x-axis, for most part everything works but when i am string to display number as string a large decimal number something like this appears "0.121000009" or "123.12200000009"

 

What's the best / recomended way to display number as a string in Tableau.

 

something like

 

12.0 should be displayed as 12

12.234 should be displayed as 12.23

0.790 should be displayed as 0.79

 

STR([number]) is not working as expected.

 

Any help would be much appreciated. Thanks.

1 answer
  1. Nov 18, 2022, 7:48 PM

    Use this:

    Use this:IF LEN(attr(SPLIT(([Data]),'.',2)))=0 THEN STR(ROUND(SUM( [Data (copy)]),0)) ELSEIFLEN(attr(SPLIT(([Data]),'.',2)))=2 THEN STR(ROUND(SUM( [Data (copy)]),2))ELSEIFLen(attr(SPLIT(([Data]),'.IF LEN(attr(SPLIT(([Data]),'.',2)))=0 THEN STR(ROUND(SUM( [Data (copy)]),0))

    ELSEIF

    LEN(attr(SPLIT(([Data]),'.',2)))=2 THEN STR(ROUND(SUM( [Data (copy)]),2))

    ELSEIF

    Len(attr(SPLIT(([Data]),'.',2)))=3 THEN STR(ROUND(SUM( [Data (copy)]),2)) end

0/9000