Could attribute [MemberOrder(NUMBER)] be made to recognise decimal numbers and then order according to ordinal value instead of string representation default comparison?

Sep 13, 2013 at 1:30 PM
Supposing all the actions or properties involved in a view rendering for which the [MemberOrder(NUMBER)] attribute was provided can be converted to numbers, would it not be very useful to have decimal numbers treated as decimal numbers when the sequence is computed?

Currently it seems that all numbers are converted to strings and then the strings are alpha numericaly compared in order to compute the sequence or ordering. If decimal numbers are treated properly it would provide a way to (almost) always be able to insert a property between two already ordered properties as one could just go down lower on the decimal numbering system.

Even if integers are some of the ordering numbers it could still work just fine since those integers could be treated like their decimal counterparts, and would anyways sort correctly when compared against the decimals.
Editor
Sep 13, 2013 at 1:53 PM
I believe the string representation is ordered as a Dewey decimal number, ie:

"1.0" < "1.0.3" < "1.1" < "2".

See for example http://searchcode.com/codesearch/view/28355586
Coordinator
Sep 13, 2013 at 2:02 PM
Perhaps just because the first two languages I learned (in the mid '70s!) were Fortran and BASIC - with their non-renumberable line-numbers - I instinctively use MemberOrder with increments of 10 to facilitate insertion. A few years back I did write a macro for VB that would re-number MemberOrder annotations, but couldn't figure it out for C#. Perhaps someone more facile with Macros might like to do it.