[NaturalComparer] Add "number length" fix

This commit is contained in:
Matt Nadareski
2017-06-01 12:58:44 -07:00
parent aaf5f0be23
commit fc1fddf030
2 changed files with 12 additions and 0 deletions

View File

@@ -87,6 +87,12 @@ namespace NaturalSort
return Style.CompareNumeric(right, left);
}
// If we have an equal part, then make sure that "longer" ones are taken into account
if (y.CompareTo(x) == 0)
{
return right.Length - left.Length;
}
return y.CompareTo(x);
}
}