Excel Custom Decimal Number Format Trailing Dot [closed]

北城以北 提交于 2019-12-07 16:25:20

问题


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?


回答1:


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

In the Format Cells dialog click the Number tab and choose General as the format.




回答2:


# are optional digits to show. 0 will enforce that digit even if it is zero. Make your number format #0.00##. This will display

  • 123 as 123.00
  • 123.00 as 123.00
  • 123.000 as 123.00
  • 123.001 as 123.001
  • 123.001111 as 123.0011


来源:https://stackoverflow.com/questions/15178668/excel-custom-decimal-number-format-trailing-dot

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!