MCPcopy Index your code
hub / github.com/apache/echarts / numericToNumber

Function numericToNumber

src/util/number.ts:774–780  ·  view source on GitHub ↗
(val: unknown)

Source from the content-addressed store, hash-verified

772 * @return Must be a typeof number. If not numeric, return NaN.
773 */
774export function numericToNumber(val: unknown): number {
775 const valFloat = parseFloat(val as string);
776 return (
777 valFloat == val // eslint-disable-line eqeqeq
778 && (valFloat !== 0 || !zrUtil.isString(val) || val.indexOf('x') <= 0) // For case ' 0x0 '.
779 ) ? valFloat : NaN;
780}
781
782/**
783 * Definition of "numeric": see `numericToNumber`.

Callers 9

testNumericFunction · 0.90
makeSeriesScopeFunction · 0.90
constructorMethod · 0.90
evaluateMethod · 0.90
evaluateMethod · 0.90
constructorMethod · 0.90
evaluateMethod · 0.90
makeValueReadableFunction · 0.90
isNumericFunction · 0.85

Calls

no outgoing calls

Tested by 1

testNumericFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…