mirror of
https://github.com/DataTables/DataTables.git
synced 2025-01-18 11:52:11 +01:00
Fix DataTables/DataTables #291 - non-string data support for non-'.' dec
numbers
This commit is contained in:
parent
6a033ad09b
commit
09bf9b200c
@ -1 +1 @@
|
||||
46d1f3bbf2385d6918482953c6b3ee5ff64ba988
|
||||
59aab63cae6169f1a282e23c493a1f758a2ce34d
|
||||
|
6
media/js/jquery.dataTables.js
vendored
6
media/js/jquery.dataTables.js
vendored
@ -124,12 +124,16 @@
|
||||
return !isNaN(integer) && isFinite(s) ? integer : null;
|
||||
};
|
||||
|
||||
// Convert from a formatted number with characters other than `.` as the
|
||||
// decimal place, to a Javascript number
|
||||
var _numToDecimal = function ( num, decimalPoint ) {
|
||||
// Cache created regular expressions for speed as this function is called often
|
||||
if ( ! _re_dic[ decimalPoint ] ) {
|
||||
_re_dic[ decimalPoint ] = new RegExp( _fnEscapeRegex( decimalPoint ), 'g' );
|
||||
}
|
||||
return num.replace( /\./g, '' ).replace( _re_dic[ decimalPoint ], '.' );
|
||||
return typeof num === 'string' ?
|
||||
num.replace( /\./g, '' ).replace( _re_dic[ decimalPoint ], '.' ) :
|
||||
num;
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user