Filtering currency not working properly
Filtering currency not working properly
![restrepo](https://secure.gravatar.com/avatar/53c97a50ba461d0e037ecceb8747ea7f/?default=https%3A%2F%2Fvanillicon.com%2F53c97a50ba461d0e037ecceb8747ea7f_200.png&rating=g&size=120)
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