Attributes that store number values, which need to be sorted or compared, need to use the technique of zero padding so that they work correctly when using lexicographical comparison. If you store two number values
10, a normal lexicographical comparison will result in the value
2 being greater than
10. This is, of course, not exactly what you would expect to get when comparing these values as numbers.
The solution is to store the number values with padding for the right number of digits.
We will store
02. Now a lexicographical comparison between
10 will return what you expect! In order to pad your data correctly, you need to know the limits of the number values that will be stored. If you know how large ...