MCPcopy Create free account
hub / github.com/breck7/scroll / _numToDecimal

Function _numToDecimal

external/.datatables.js:1066–1072  ·  view source on GitHub ↗
(num, decimalPoint)

Source from the content-addressed store, hash-verified

1064 // Convert from a formatted number with characters other than `.` as the
1065 // decimal place, to a Javascript number
1066 var _numToDecimal = function (num, decimalPoint) {
1067 // Cache created regular expressions for speed as this function is called often
1068 if (!_re_dic[decimalPoint]) {
1069 _re_dic[decimalPoint] = new RegExp(_fnEscapeRegex(decimalPoint), "g")
1070 }
1071 return typeof num === "string" && decimalPoint !== "." ? num.replace(/\./g, "").replace(_re_dic[decimalPoint], ".") : num
1072 }
1073
1074 var _isNumber = function (d, decimalPoint, formatted, allowEmpty) {
1075 var type = typeof d

Callers 2

_isNumberFunction · 0.85
__numericReplaceFunction · 0.85

Calls 1

replaceMethod · 0.80

Tested by

no test coverage detected