Filtering currency not working properly
Filtering currency not working properly
restrepo
Posts: 4Questions: 2Answers: 0
As I understand it should work automatically, but currently I have currency values in a column
for example "$1,200" or "$5.57"
but when searching "1200" the row isn't displayed.
I tried setting it manually with
type: "num-fmt" and "html-num-fmt"
but the result is still the same, is there anything I can do?
This discussion has been closed.
Answers
Additional information - class of the currency row was set to sorting_1, as
<td class="sorting_1">$1,200</td>
DataTables will search on the original data, so if your original data is
$1,200
, then you'd need to search1,200
(i.e. with the comma).If however you use DataTables to format a number (e.g.
1200
), then yes you would be able to search on just 1200.Allan