حدد رقم عشري مخصص وفواصل المجموعات للمصنف
Contents
[
Hide
]
في Microsoft Excel ، يمكنك تحديد الفواصل العشرية المخصصة والآلاف بدلاً من استخدام فواصل النظام منخيارات Excel المتقدمة كما هو موضح في الصورة أدناه.
يوفر Aspose.Cells ملفWorkbookSettings.setNumberDecimalSeparator () وWorkbookSettings.setNumberGroupSeparator () خصائص لتعيين الفواصل المخصصة لتنسيق / تحليل الأرقام.
تحديد فواصل مخصصة باستخدام Microsoft Excel
- فتحخيارات في الملف التبويب.
- افتح المتقدم التبويب.
- قم بتغيير الإعدادات في ملفخيارات التحرير الجزء.
تُظهر لقطة الشاشة التالية ملفخيارات Excel المتقدمة ويسلط الضوء على القسم لتحديدفواصل مخصصة.
تحديد الفواصل المخصصة باستخدام Aspose.Cells
يوضح نموذج الكود التالي كيفية تحديد الفواصل المخصصة باستخدام Aspose.Cells API. وهو يحدد الرقم العشري المخصص وفواصل المجموعة كنقطة ومسافة على التوالي. إذن الرقم123,456.789 سيتم عرضها على شكل123 456.789 كما هو موضح في لقطة الشاشة التي توضح الإخراج PDF الناتج عن الكود.
This file contains hidden or 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-Java | |
// The path to the documents directory. | |
String dataDir = Utils.getDataDir(SpecifyingCustomSeparators.class); | |
Workbook workbook = new Workbook(); | |
// Specify custom separators | |
workbook.getSettings().setNumberDecimalSeparator('.'); | |
workbook.getSettings().setNumberGroupSeparator(' '); | |
Worksheet worksheet = workbook.getWorksheets().get(0); | |
Cell cell = worksheet.getCells().get("A1"); | |
cell.putValue(123456.789); | |
Style style = cell.getStyle(); | |
style.setCustom("#,##0.000;[Red]#,##0.000"); | |
cell.setStyle(style); | |
worksheet.autoFitColumns(); | |
workbook.save("output.pdf"); |