excel interop : NumberFormat #,##0.000 doesn't

2019-09-12 20:16发布

I developed a C# utility class called ExcelGenerator that generate a List of objects to excel. I want to display double numbers in this format : 3 288,523.

NumberFormat = "#,##0.000" doesn't display the expected result

This is the method :

public void FormatNombre(string frm)
{
_excel.Selection.NumberFormat = frm;
}

and this is the call :

eg.FormatNombre("#,##0.000");

Number still displayed like this : 3288,522.542

1条回答
霸刀☆藐视天下
2楼-- · 2019-09-12 20:53

You want to format 3288523.542 to 3 288,523?

Try something like this:

[>999]#" "###","###;#

Edit: Just noticed looks like you are trying use French: Try this format.

# ##0,000
查看更多
登录 后发表回答