MCPcopy Index your code
hub / github.com/ChartGPU/ChartGPU / parsePercent

Function parsePercent

src/renderers/createCandlestickRenderer.ts:51–56  ·  view source on GitHub ↗
(value: string)

Source from the content-addressed store, hash-verified

49};
50
51const parsePercent = (value: string): number | null => {
52 const m = value.trim().match(/^(\d+(?:\.\d+)?)%$/);
53 if (!m) return null;
54 const p = Number(m[1]) / 100;
55 return Number.isFinite(p) ? p : null;
56};
57
58const isTupleDataPoint = (p: OHLCDataPoint): p is OHLCDataPointTuple => Array.isArray(p);
59

Callers 1

prepareFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected