Excel自定义十进制数字格式尾随点 [英] Excel Custom Decimal Number Format Trailing Dot
问题描述
当我设置自定义数字格式#0.####
时,它对于整数123
和& 123.23
,但不适用于123.00
这样的十进制数字,因为它显示为123.
When I set custom number format #0.####
, it works fine with whole numbers 123
& 123.23
, but it is not working with decimal numbers like 123.00
, as it is displaying this as 123.
如何设置正确的数字格式,以免在最后显示.
?
How can one set a correct number format so as not to display the .
at the end?
推荐答案
您可以在Excel 2007和更高版本中使用条件格式来做到这一点.如已完成,使用自定义格式#0.####
格式化单元格.然后,如果单元格值没有小数部分,则添加自定义格式以使用通用格式".
You can use conditional formatting to do this, in Excel 2007 and later, I believe. Format the cells with your custom format of #0.####
as you've already done. Then add custom formatting to use the General Format if the cell value has no decimal portion.
在常规格式"对话框中,添加基于公式的格式.在设置此公式为真的值的格式"框中,输入:
In the Condtional Formatting dialog add a formula-based format. In the "Format values where this formula is true" box enter:
=INT(A2)=A2
在设置单元格格式"对话框中,单击数字"选项卡,然后选择General
作为格式.
In the Format Cells dialog click the Number tab and choose General
as the format.
这篇关于Excel自定义十进制数字格式尾随点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!