需要在兩個地方設置
//Adding a numeric value to "A2" cell string a = "100"; worksheet.Cells["A2"].PutValue(a, true); --①主要是這個,增加一個參數,一般不會用到 //Getting the Style of the A2 Cell style = worksheet.Cells["A2"].GetStyle(); //Setting the display format to number 9 to show value as percentage style.Number = 1; -- ②這個Number設置 官方有API可以看到 相應的設置 //Applying the style to the A2 cell worksheet.Cells["A2"].SetStyle(style);