Aspose.Cells單元格轉換為數字格式


需要在兩個地方設置

           //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);
  


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM