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

Function _isNumber

external/.datatables.js:1074–1098  ·  view source on GitHub ↗
(d, decimalPoint, formatted, allowEmpty)

Source from the content-addressed store, hash-verified

1072 }
1073
1074 var _isNumber = function (d, decimalPoint, formatted, allowEmpty) {
1075 var type = typeof d
1076 var strType = type === "string"
1077
1078 if (type === "number" || type === "bigint") {
1079 return true
1080 }
1081
1082 // If empty return immediately so there must be a number if it is a
1083 // formatted string (this stops the string "k", or "kr", etc being detected
1084 // as a formatted number for currency
1085 if (allowEmpty && _empty(d)) {
1086 return true
1087 }
1088
1089 if (decimalPoint && strType) {
1090 d = _numToDecimal(d, decimalPoint)
1091 }
1092
1093 if (formatted && strType) {
1094 d = d.replace(_re_formatted_numeric, "")
1095 }
1096
1097 return !isNaN(parseFloat(d)) && isFinite(d)
1098 }
1099
1100 // A string without HTML in it can be considered to be HTML still
1101 var _isHtml = function (d) {

Callers 2

_htmlNumericFunction · 0.85
.datatables.jsFile · 0.85

Calls 3

_emptyFunction · 0.85
_numToDecimalFunction · 0.85
replaceMethod · 0.80

Tested by

no test coverage detected