Habib Gherairi
Habib Gherairi

Reputation: 291

excel interop : NumberFormat #,##0.000 doesn't display the expected result

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

Upvotes: 0

Views: 3075

Answers (1)

Crispy
Crispy

Reputation: 5637

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

Upvotes: 1

Related Questions