Specifying Sort Warning While Sorting Data

Possible Usage Scenarios

Please consider this textual data, e.g., {11, 111, 22}. This textual data is sorted because, in terms of text, 111 comes before 22. However, if you want to sort this data not as text but as numbers, it will become {11, 22, 111} because numerically 111 comes after 22. Aspose.Cells for Python via .NET provides the DataSorter.sort_as_number property to deal with this issue. Please set this property to true, and your textual data will be sorted as numerical data. The following screenshot shows the sort warning displayed by Microsoft Excel when textual data that looks like numerical data is sorted.

todo:image_alt_text

Sample Code

The following sample code illustrates the usage of the DataSorter.sort_as_number property as explained earlier. Please check its sample Excel file and output Excel file for more help.