Feature Request: custom currency symbols for types
Feature Request: custom currency symbols for types
WIR3D
Posts: 12Questions: 4Answers: 1
$('#example').dataTable( {
"columnDefs": [
{ "type": "num-fmt", "symbols":"R$", "targets": 0 }
]
} );
Should be self explanatory. for now I'm just using a modified plugin (the deprecated currency one) so no rush. just a suggestion.
This question has accepted answers - jump to:
This discussion has been closed.
Answers
Good suggestion - thanks for this. This is where DataTables currently defines the currency symbols.
I did wonder about adding in
R
so it would match (for example)R$123
but it matches in any order, so a simpleR
would match which wouldn't be right!Without a more complex algorithm (prefix / postfix check for example) a sorting plug-in is the best way of doing it. Perhaps you might be willing to post your modification so others can also benefit?
Allan
most definitely, let me just finish it. getting some false positives at the moment.
Honestly though, I wouldn't be worried about the order in which it matches the currency, as long as it matches the currency and doesn't have false positives
it needs some more tweaking to be more generic, I haven't figured a way to handle dynaimic type names on the sorter side.
Thanks for sharing with us. That is almost identical to the formatted numbers plug-in :-)
Allan