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

Function __numericReplace

external/.datatables.js:11841–11870  ·  view source on GitHub ↗
(d, decimalPlace, re1, re2)

Source from the content-addressed store, hash-verified

11839 })
11840
11841 var __numericReplace = function (d, decimalPlace, re1, re2) {
11842 if (d !== 0 && (!d || d === "-")) {
11843 return -Infinity
11844 }
11845
11846 var type = typeof d
11847
11848 if (type === "number" || type === "bigint") {
11849 return d
11850 }
11851
11852 // If a decimal place other than `.` is used, it needs to be given to the
11853 // function so we can detect it and replace with a `.` which is the only
11854 // decimal place Javascript recognises - it is not locale aware.
11855 if (decimalPlace) {
11856 d = _numToDecimal(d, decimalPlace)
11857 }
11858
11859 if (d.replace) {
11860 if (re1) {
11861 d = d.replace(re1, "")
11862 }
11863
11864 if (re2) {
11865 d = d.replace(re2, "")
11866 }
11867 }
11868
11869 return d * 1
11870 }
11871
11872 $.extend(true, DataTable.ext.renderer, {
11873 footer: {

Callers 1

.datatables.jsFile · 0.85

Calls 2

_numToDecimalFunction · 0.85
replaceMethod · 0.80

Tested by

no test coverage detected