我希望能够看到每个数字,但右边没有任何填充零。
所以我像这样格式化单元格:
#,##0.################################################################
但是,现在 Excel 也显示整数的小数点:
我尝试了条件格式,但不幸的是,Excel 无法确定哪些数字应被视为整数 - 由于产生这些数字的浮点数学中的怪癖(Excel 函数)。
我尝试使用条件格式以红色突出显示整数,以查看 Excel 是否可以区分整数和分数:
MOD()公式:
=MOD(INDIRECT("R"&ROW()&"C"&COLUMN(),FALSE),1)=0
INT() 公式:
=INDIRECT("R"&ROW()&"C"&COLUMN(),FALSE)-INT(INDIRECT("R"&ROW()&"C"&COLUMN(),FALSE))=0
两个条件格式公式具有相同的效果,准确率约为 80%,但在我的示例中仍然未能捕捉到几个实例——我推测是由于浮点数学怪癖:
有没有办法像这样始终如一地格式化数字?
或者有没有办法在不损害值的准确性的情况下解决浮点问题?
(这些数字用于科学测量目的,用于机械工程开发项目,因此准确性至关重要。)
如果您想自己测试,这里是 CSV 格式的数字。
只要知道这些数字是通过我的电子表格中的公式计算得出的,所以1760
实际上可能是1760.000000000000000000001
这样。
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