Cell Data Format whole column to 1 or 2 decimal places

I have data on truck gas mileage during tow and not towing, including price of fuel. I have two columns that display "# of Gallons Used @ 14.0 MPG" when not towing and "# of Gallons Used While Towing". Both columns were set the same on the "Inspector Cell Data Format". Under "Cell" both columns are set to "Automatic Data Format" and both are set to "Auto Decimals" yet the 14.0 MPG column dispalys the numbers up to 15 decimal places and the 10.0 MPG column displays to one decimal place. I know that I can change from "Auto" and add "2 decimal places" but I would like to know why the inconsistency. Is there another location to fix this issue?


Thanks in advance,

MacBook Pro 13″, macOS 12.2

Posted on Mar 9, 2022 7:43 AM

Reply
Question marked as Top-ranking reply

Posted on Mar 9, 2022 9:18 AM

This is how "auto" decimal places works.

5/14 = 0.3571... It requires all the decimal places it has to provide you the result.

5/10 = 0.5 It requires one decimal place to give you the exact result.

10/10 = 1 It requires no decimal places to give you the exact result.


If you want a consistent number of decimal places, change them all from "auto" to whatever number of decimal places you want. Note that this only changes how the number is displayed, it does not affect the value in the cell. The value of the calculation 5/14 will still be 0.3571... in the cell even if it is being displayed as 0.36. If you want the value to actually be rounded to a specific number of decimal places, use the ROUND function (or one of the other rounding functions).

Similar questions

6 replies
Question marked as Top-ranking reply

Mar 9, 2022 9:18 AM in response to gaucho10

This is how "auto" decimal places works.

5/14 = 0.3571... It requires all the decimal places it has to provide you the result.

5/10 = 0.5 It requires one decimal place to give you the exact result.

10/10 = 1 It requires no decimal places to give you the exact result.


If you want a consistent number of decimal places, change them all from "auto" to whatever number of decimal places you want. Note that this only changes how the number is displayed, it does not affect the value in the cell. The value of the calculation 5/14 will still be 0.3571... in the cell even if it is being displayed as 0.36. If you want the value to actually be rounded to a specific number of decimal places, use the ROUND function (or one of the other rounding functions).

Mar 9, 2022 8:05 AM in response to gaucho10

It depends on the results in the cell. If the result only requires 2 decimal places, "automatic" gives it 2 decimal places. If it requires 3 it gets 3. If it requires 15 or more it gets as many as it can get (the precision is limited to 15 total digits so "15 decimal places" may end with a few zeros).


If you want two decimal places, set it to 2 decimal places.

Mar 10, 2022 10:35 AM in response to gaucho10

As noted by Badunit, "Automatic" displays as many places after the decimal as needed to show the result of the calculation, up to limit of 15 significant digits.


In the base 10 system, division by 7 (or by a multiple of seven) of any number that is not itself a multiple of 7 has a decimal result that never finishes. Note repeating group '571428' in all of your 14 MPG column examples, except for 2.5, the result for 35 (a multiple of 7) miles.


Regards,

Barry



Mar 10, 2022 5:25 AM in response to Barry

Barry, thanks for the reply but I am not concerned between the whole numbers and the one decimal place numbers in the "# of Gallons Used @ 10.0 MPG". My question is about the difference between the "# of Gallons Used @ 14.0 MPG" column and the "# of Gallons Used @ 10.0 MPG" column. Both columns are set the same yet one column displays up to 15 dec. points and the other to one dec. point.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Cell Data Format whole column to 1 or 2 decimal places

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.