4 Replies Latest reply on Nov 1, 2016 12:19 PM by Shawn Wallwork

# Rounding to the hundredth or tens place for large numbers

I have a number in the hundreds of thousands.

It looks neater when looking at a lot of numbers to at least round the last digit. But I can't get this to work with commas, I can get decimals to behave when Tableau thinks it is in the thousands, but not with commas. Any ideas? Ideally, I would do this in formatting and not as a calculation as that would be many calculations to modify. I just can't get the Tableau number format to understand I want one digit and not three when entering a "0" or "#" in the custom formats.

Here is an example of what I mean:

#,##0;-#,##0

is the same as:

#,0;-#,##0

Even though two "#"s have been removed after the first comma, it is still recognizing as a thousands precision.

At which point it looks like this (with the before mentioned format of #,.0;-#,##0):

What gives? It only recognizes it with decimals. Then I can add two dummy 0s under quotation marks of "00":

#,.0"00";-#,##0

How can I get this decimal behavior with commas?

Victor.

• ###### 1. Re: Rounding to the hundredth or tens place for large numbers

You mean like this:

--Shawn

• ###### 2. Re: Rounding to the hundredth or tens place for large numbers

Similar. Ideally I would have it round to "2,300" without decimals. But with commas, I can't get the (.0"00") to work with commas instead of decimal points.

Thanks,

Victor.

• ###### 3. Re: Rounding to the hundredth or tens place for large numbers

If i understand it properly you have your data formatted in a way that tableau can't recognize whether comma is a thousand or decimal separator. It might not be the most elegant solution but how about going through string?

float(replace(str([Value Field]),",",""))

• ###### 4. Re: Rounding to the hundredth or tens place for large numbers

Like this:

Also if you first set up a Number to the thousands:

And then change immediately to the Custom option it will give you this:

Then you can delete the 'K's. This is a good way to figure out the way Tableau writes the different formats.

--Shawn