Hello,
I am creating a field for numbers. For example I want to store the following:
94
81.25
689
5
What is the best way to store these numbers if I want to order them later by their numerical value. For example, I want to store and then order them from max to min (DESC), like this:
689
94
81.25
5
If I use a VARCHAR field type it sorts DESC like this (stores correctly, but sorts non-numeric).
94
81.25
689
5
If I use a DECIMAL (10,5) field type for example, it orders/sorts them correctly however it stores and displays the numbers like this (don't want those extra zeros!):
689.00000
94.00000
81.25000
5.00000
However, I want to sort, store, and display like this (no extra zeros and correct numerical order):
689
94
81.25
5
Thanks in advance.