Alphanumeric sorting of files
The file manager in Drive uses alphanumeric sorting to display files. It interprets the characters of the filename as a string, which is evaluated sequentially. A "1" always comes before a "2", but a "2" comes after an "11". This can lead to unexpected effects, for example, this sorting:
1_Invoice-January.pdf
11_Invoice-November.pdf
12_Invoice-December.pdf
2_Invoice-February.pdf
Figure 1: Single-digit numbering is not a good idea. Leading zeros will solve the problem.
If you want to display these invoices sorted by month, it helps to add the number of the month in two-digit notation at the beginning of the filename (i.e., with a leading zero):
01_Invoice-January.pdf
02_Invoice-February.pdf
11_Invoice-November.pdf
12_Invoice-December.pdf
Figure 2: Invoices or similar files can be sorted well by month.
Figure 3: For letters, alphabetical order applies.
If you want to store and display a larger number of files in a sorted way, it is recommended to start with two (or more) leading zeros, such as 001-Invoice-Customer1.pdf
. This creates space for 999 entries.