You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DB (MySQL etc.): 10.2.12-MariaDB-10.2.12+maria~jessie
PHP version: 7.2.24-0ubuntu0.18.04.1 (fpm-fcgi)
SMW version: 3.1.5
SRF version: 3.1.0
Issue
When using a format=datatables with a query that contains a printout for a property of type "Quantity", the respective column is sorted as string instead of number.
Expected result: ...
Order should be: Test_001/150€ - Test_002/200€ - Test_003/1000€
Observed result: ...
Order is: Test_003/1000€ - Test_001/150€ - Test_002/200€
Hints
The jQuery DataTables widget seems to support currency-sorting. Unfortunately SMW has no concept of that is a currency. It only knows about "Quantity". But maybe columns of type quantity can have a generic sorter that just strips any unit from the value, thus making it a number again
The text was updated successfully, but these errors were encountered:
kghbln
changed the title
Format datatable does not properly sort values of type currency
[Datatable] Value for properties of datatype Quantiy are not sorted properly
Mar 24, 2020
kghbln
changed the title
[Datatable] Value for properties of datatype Quantiy are not sorted properly
[Datatables] Value for properties of datatype Quantiy are not sorted properly
Mar 24, 2020
Thanks for reporting. Yeah, support for this would be great.
kghbln
changed the title
[Datatables] Value for properties of datatype Quantiy are not sorted properly
[Datatables] Value for properties of datatype Quantity are not sorted properly
Mar 24, 2020
Setup
Issue
When using a
format=datatables
with a query that contains a printout for a property of type "Quantity", the respective column is sorted as string instead of number.Steps to reproduce
(recommendation is to use the sandbox)
[[Has type::Quantity]][[Corresponds to::1 €]]
[[SomeProp::150]]
[[SomeProp::200]]
[[SomeProp::1000]]
Expected result: ...
Order should be: Test_001/150€ - Test_002/200€ - Test_003/1000€
Observed result: ...
Order is: Test_003/1000€ - Test_001/150€ - Test_002/200€
Hints
The jQuery DataTables widget seems to support currency-sorting. Unfortunately SMW has no concept of that is a currency. It only knows about "Quantity". But maybe columns of type quantity can have a generic sorter that just strips any unit from the value, thus making it a number again
The text was updated successfully, but these errors were encountered: