Michal
Michal

Reputation: 325

Custom number format with unit in EPPlus

Is it possible to set the format for a cell/column in excel like shown in the image using EPPlus? What's the proper syntax to achieve that? The following code doesn't work.

worksheet.Cells[row, col].Style.Numberformat.Format = @"@"" Mhz""";

enter image description here

Upvotes: 0

Views: 387

Answers (1)

Krishna Varma
Krishna Varma

Reputation: 4250

convert the value to string

worksheet.Cells[row, col].Style.Numberformat.Format = @"@"" Mhz""";
worksheet.Cells[row, col].Value = "10.5";

Upvotes: 1

Related Questions