Support for variable number of decimal places
See original GitHub issueDescription
I have a scientific database with tables of data. We format the numbers for decimal places, but we provide a tooltip to see the un-manipulated value. Those values have a variable number of decimal places, which apparently, the default bootstrap-table sort mechanism doesn’t support, so I tried adding your natural sort functionality to get the correct numeric sort… however, it seems that natural sort has the same issue. I’m not entirely sure what is dictating the sort behavior. At first, I thought it was the number of digits (ignoring the decimal), but the fixed-width font below shows that’s not the case, so I’m not entirely sure what’s going on… This yields an incorrect sort, as seen here:
I clipped out the middle of the image to be able to see the header and the mis-sorted values.
So for example, in the screenshot above, the values it’s using for sorting are:
481379.86936945
481379.86936945
4001067.45756464
83861369.518249
941478.5191909212
11550635.0368925
I intend to either add a hidden value in front as a work-around or implement a custom-sort.
I apologize if this behavior is already defined as a known limitation of the sort (which is why I’m submitting this as a feature request as opposed to a bug - I’m guessing this is a known limitation).
Issue Analytics
- State:
- Created 2 years ago
- Comments:14 (9 by maintainers)
Top GitHub Comments
As i said the option is similar to your requested feature. Instead of sorting of data attribute the column will be sorted by a other column. Example: https://live.bootstrap-table.com/code/UtechtDustin/10000
Please provide us an example using our editor.