Excel Dosyasında Saklanacak Anlamlı Rakamları Belirtme
Contents
[
Hide
]
Olası Kullanım Senaryoları
Varsayılan olarak, Aspose.Cells, yalnızca 15 anlamlı basamak depolayan MS-Excel’in aksine, excel dosyasında çift değerlerin 17 önemli basamağını depolar. Aspose.Cells’in varsayılan davranışını 17 anlamlı basamaktan 15 anlamlı basamağa değiştirebilirsiniz.CellsHelper.SignificantDigitsEmlak.
Excel dosyasında saklanacak Önemli Basamakların Belirlenmesi
Aşağıdaki örnek kod, Aspose.Cells’i excel dosyasında çift değerleri depolarken 15 anlamlı basamak kullanmaya zorlar. lütfen kontrol edinizçıktı excel dosyası . Uzantısını .zip olarak değiştirin ve açın ve göreceksiniz, excel dosyasının içinde yalnızca 15 önemli basamak saklanıyor. Aşağıdaki ekran görüntüsü,CellsHelper.SignificantDigitsçıktı excel dosyasındaki özellik.
Basit kod
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET | |
// The path to the documents directory. | |
string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | |
//By default, Aspose.Cells stores 17 significant digits unlike | |
//MS-Excel which stores only 15 significant digits | |
CellsHelper.SignificantDigits = 15; | |
//Create workbook | |
Workbook workbook = new Workbook(); | |
//Access first worksheet | |
Worksheet worksheet = workbook.Worksheets[0]; | |
//Access cell A1 | |
Cell c = worksheet.Cells["A1"]; | |
//Put double value, only 15 significant digits as specified by | |
//CellsHelper.SignificantDigits above will be stored in excel file just like MS-Excel does | |
c.PutValue(1234567890.123451711); | |
//Save the workbook | |
workbook.Save(dataDir + "out_SignificantDigits.xlsx"); |