qlik-oss/sn-table

View on GitHub
src/table/utils/is-numeric.ts

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
import { Cell } from "../../types";

export const isNumeric = (val: string | number) => !Number.isNaN(+val);

export const isNumericCell = (cell: EngineAPI.INxCell | Cell) =>
  !!((cell.qNum || cell.qNum === 0) && isNumeric(cell.qNum));