MCPcopy
hub / github.com/chartjs/Chart.js / toDimension

Function toDimension

src/helpers/helpers.core.ts:91–94  ·  view source on GitHub ↗
(value: number | string, dimension: number)

Source from the content-addressed store, hash-verified

89 : +value / dimension;
90
91export const toDimension = (value: number | string, dimension: number) =>
92 typeof value === 'string' && value.endsWith('%') ?
93 parseFloat(value) / 100 * dimension
94 : +value;
95
96/**
97 * Calls `fn` with the given `args` in the scope defined by `thisArg` and returns the

Callers 2

updateMethod · 0.85
_addGraceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected