Custom filtering - range search not working because of £ signs
Custom filtering - range search not working because of £ signs
I have applied custom filters to my tables using this method, with the aim of being able to limit the max price of the items.
https://datatables.net/examples/plug-ins/range_filtering.html
I came across problems since my data is prices, meaning it includes the £ sign. I was wondering what is the best method of having it filter prices despite that symbol. I can imagine checking if the values "isNaN" is what's causing the issue, but I have very little experience working in Javascript. Any help would be appreciated.
Thank you
Answers
You'd need to strip the
£
symbol before converting the string to a number in the search functionvalue.replace('£', '')
should do that.Allan