1 min readfrom Microsoft Excel | Help & Support with your Formula, Macro, and VBA problems | A Reddit Community

Stop Excel showing decimal point when no fractional digits

Our take

Are you struggling with Excel displaying a decimal point even when there are no fractional digits? Many users seek to format cells to show a thousands separator and up to two fractional digits without the decimal point appearing unnecessarily. While the format string "#,##0.##" works in VB and C#, it seems to encounter a bug in Excel that retains the decimal.

I want to format a range of cells such that a thousands separator is displayed if needed, and up to two fractional digits are displayed. If there are no fractional digits, then I do not want the decimal point displayed.

In VB and C#, the format string to achieve this is "#,##0.##". But when I use this string in Excel, the decimal point is still displayed even when there are no fractional digits. This appears to be a bug with Excel. Has anyone found a workaround?

If anyone is curious, I'm creating the spreadsheet from code using ClosedXML. So I can set the format string for cells, but I cannot go in and change Excel settings for all the users of my software.

submitted by /u/NobodyAdmirable6783
[link] [comments]

Read on the original site

Open the publisher's page for the full experience

View original article

Related Articles

Tagged with

#Excel alternatives for data analysis#Excel compatibility#Excel alternatives#natural language processing for spreadsheets#generative AI for data analysis#digital transformation in spreadsheet software#no-code spreadsheet solutions#rows.com#modern spreadsheet innovations#machine learning in spreadsheet applications#enterprise-level spreadsheet solutions#collaborative spreadsheet tools#AI-driven spreadsheet solutions#cloud-based spreadsheet applications#financial modeling with spreadsheets#automation in spreadsheet workflows#AI-powered spreadsheet#spreadsheet API integration