MCPcopy Create free account
hub / github.com/culvertsoft/mgen / isNumeric

Function isNumeric

mgen-javascriptlib/src/main/javascript/mgen-lib.js:512–518  ·  view source on GitHub ↗
(number)

Source from the content-addressed store, hash-verified

510 }
511
512 function isNumeric(number) {
513 // Borrowed from jQuery with comment:
514 // parseFloat NaNs numeric-cast false positives (null|true|false|"")
515 // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
516 // subtraction forces infinities to NaN
517 return number - parseFloat(number) >= 0;
518 }
519
520 /**
521 * @param derived {string} hash from derived type

Callers 2

checkIntFunction · 0.85
checkFloatFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected