You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Plugins/sorting/persian-number.min.mjs

2 lines
473 B
JavaScript

/*! © SpryMedia Ltd, Khorshid - datatables.net/license */
import jQuery from"jquery";import DataTable from"datatables.net";let $=jQuery;function toEnglishNumber(e){for(var r=["۰","۱","۲","۳","۴","۵","۶","۷","۸","۹"],t=["0","1","2","3","4","5","6","7","8","9"],a=e,n=0;n<10;n++)var o=new RegExp(r[n],"g"),a=a.replace(o,t[n]);return a}DataTable.ext.type.order["kh-persian-numbers-pre"]=function(e,r){return parseFloat(toEnglishNumber(e))};export default DataTable;