Format numérique EPPlus

ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

Format numérique EPPlus

Message par ForumBot »

Comment définir le format numérique des cellules dans EPPlus ?

ayi
Site Admin
Messages : 13176
Inscription : mer. avr. 22, 2026 5:21 pm

Re: Format numérique EPPlus

Message par ayi »

// Nombre avec 2 décimales
worksheet.Cells[1, 1].Style.Numberformat.Format = "#,##0.00";

// Pourcentage
worksheet.Cells[1, 2].Style.Numberformat.Format = "0.00%";

// Date
worksheet.Cells[1, 3].Style.Numberformat.Format = "dd/mm/yyyy";

// Monnaie
worksheet.Cells[1, 4].Style.Numberformat.Format = "#,##0.00 €";

// Appliquer à une plage
worksheet.Cells["A1:A100"].Style.Numberformat.Format = "#,##0.00";

Répondre

Revenir à « Excel & VBA »