问题
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:
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
来源:https://stackoverflow.com/questions/15791922/excel-interop-numberformat-0-000-doesnt-display-the-expected-result