custom-cards / flex-table-card

Highly Flexible Lovelace Card - arbitrary contents/columns/rows, regex matched, perfect to show appdaemon created content and anything breaking out of the entity_id + attributes concept
GNU General Public License v3.0
198 stars 23 forks source link

sort - by integer #43

Closed chaimt closed 3 years ago

chaimt commented 3 years ago

I am sorting by the state column that is a string but have an integer value, and the sort is not correct: 195 354 4

daringer commented 3 years ago

in order to get a proper sort for a given column you'll have to convert the value to an integer or float, the modify key is made for that, please check the documentation, like this one. If you are sure that you'll always have an integer the issue should be easily solvable using something like

modify: parseInt(x)
chaimt commented 3 years ago

works like a charm thanks