Excel number format adds decimal point for whole numbers

Giffyguy

I want to be able to see every digit, but without any padded zeros on the right.
So I formatted the cells like this:
#,##0.################################################################

However, now Excel is displaying a decimal point for whole numbers as well:

enter image description here

I tried conditional formatting, but unfortunately Excel can't figure out which numbers should be treated as integers - due to quirks in the floating-point math that produced these numbers (Excel functions).

I tried using conditional formatting to highlight integers in red, to see if Excel could differentiate between integers and fractions:

MOD() formula:
=MOD(INDIRECT("R"&ROW()&"C"&COLUMN(),FALSE),1)=0

INT() formula:
=INDIRECT("R"&ROW()&"C"&COLUMN(),FALSE)-INT(INDIRECT("R"&ROW()&"C"&COLUMN(),FALSE))=0

Both conditional formatting formulas had the same effect, about 80% accuracy, still failing to catch several instances in my example - I presume due to floating-point math quirks:

enter image description here

Is there a way to consistently format numbers like this?

Or is there a way to get around the floating-point issues, without damaging the accuracy of the values?
(These numbers are being used for scientific measurement purposes, for a mechanical engineering development project, so accuracy is paramount.)

Here are the numbers in CSV format, if you want to test for yourself.
Just know that these numbers are produced by formula calculations in my spreadsheet, so 1760 might actually be 1760.000000000000000000001 or something.

0.0254,1,0.0833333333333333,0.0277777777777778,0.0000157828282828283,25.4,2.54,0.0254,0.0000254
0.3048,12,1,0.333333333333333,0.000189393939393939,304.8,30.48,0.3048,0.0003048
0.9144,36,3,1,0.000568181818181818,914.4,91.44,0.9144,0.0009144
1609.344,63360,5280,1760,1,1609344,160934.4,1609.344,1.609344
0.001,0.0393700787401575,0.00328083989501312,0.00109361329833771,0.000000621371192237334,1,0.1,0.001,0.000001
0.01,0.393700787401575,0.0328083989501312,0.0109361329833771,0.00000621371192237334,10,1,0.01,0.00001
1,39.3700787401575,3.28083989501312,1.09361329833771,0.000621371192237334,1000,100,1,0.001
1000,39370.0787401575,3280.83989501312,1093.61329833771,0.621371192237334,1000000,100000,1000,1
cybernetic.nomad

I think this is what you want.

1) Format all cells with

 #,##0.################################################################

2) Use conditional formatting with the following formula:

=ROUND(A1,0)=A1

And use it with the following format:

0

(alternatively, use "Number" with zero decimals)

With your data set: enter image description here

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Make decimal point to whole numbers

From Dev

Make decimal point to whole numbers

From Dev

Prevent number_format from rounding numbers - add commas and keep the decimal point - PHP

From Dev

Pasting decimal numbers in excel / comma and point decimal separator

From Dev

Can I format decimal points even if user inputted whole number?

From Dev

How to find shortest decimal number between two floating point numbers

From Dev

Comparing version numbers with more than one decimal point in Excel VBA

From Dev

Excel to csv file conversion - conserve numbers after the decimal point

From Dev

Excel to csv file conversion - conserve numbers after the decimal point

From Dev

How to format a decimal (floating point) number parameter in url

From Dev

Sorting an array of decimal & whole numbers

From Dev

Why does Excel parse numbers with more than two decimal places as whole numbers?

From Dev

How to separate number by its decimal point in Excel/Calc?

From Dev

Function Returning Whole Number, not Decimal

From Dev

Regular Expression which read whole number and decimal numbers ending with xx.5

From Dev

Format the number of decimal points

From Dev

Set format for decimal number

From Dev

Display number with decimal places instead of whole number

From Dev

How to round of a decimal number to lowest whole number?

From Dev

How to reliably format a floating point number to a specified number of decimal places in Haxe

From Dev

How to reliably format a floating point number to a specified number of decimal places in Haxe

From Dev

Get all whole and decimal numbers from string

From Dev

Convert floating point numbers to decimal numbers

From Dev

Regex for decimal number with optional decimal point

From Dev

Format for number with floating point

From Dev

Java regex to check if string is valid number format (comma and decimal point placing)

From Dev

Adding decimal after whole number in Lua

From Dev

Bash Comparing Whole number to Decimal Errors

From Dev

mysql SELECT ... WHERE decimal is whole number

Related Related

  1. 1

    Make decimal point to whole numbers

  2. 2

    Make decimal point to whole numbers

  3. 3

    Prevent number_format from rounding numbers - add commas and keep the decimal point - PHP

  4. 4

    Pasting decimal numbers in excel / comma and point decimal separator

  5. 5

    Can I format decimal points even if user inputted whole number?

  6. 6

    How to find shortest decimal number between two floating point numbers

  7. 7

    Comparing version numbers with more than one decimal point in Excel VBA

  8. 8

    Excel to csv file conversion - conserve numbers after the decimal point

  9. 9

    Excel to csv file conversion - conserve numbers after the decimal point

  10. 10

    How to format a decimal (floating point) number parameter in url

  11. 11

    Sorting an array of decimal & whole numbers

  12. 12

    Why does Excel parse numbers with more than two decimal places as whole numbers?

  13. 13

    How to separate number by its decimal point in Excel/Calc?

  14. 14

    Function Returning Whole Number, not Decimal

  15. 15

    Regular Expression which read whole number and decimal numbers ending with xx.5

  16. 16

    Format the number of decimal points

  17. 17

    Set format for decimal number

  18. 18

    Display number with decimal places instead of whole number

  19. 19

    How to round of a decimal number to lowest whole number?

  20. 20

    How to reliably format a floating point number to a specified number of decimal places in Haxe

  21. 21

    How to reliably format a floating point number to a specified number of decimal places in Haxe

  22. 22

    Get all whole and decimal numbers from string

  23. 23

    Convert floating point numbers to decimal numbers

  24. 24

    Regex for decimal number with optional decimal point

  25. 25

    Format for number with floating point

  26. 26

    Java regex to check if string is valid number format (comma and decimal point placing)

  27. 27

    Adding decimal after whole number in Lua

  28. 28

    Bash Comparing Whole number to Decimal Errors

  29. 29

    mysql SELECT ... WHERE decimal is whole number

HotTag

Archive