MCPcopy Create free account
hub / github.com/DavidHDev/react-bits / clamp

Function clamp

src/tailwind/Components/ProfileCard/ProfileCard.jsx:13–13  ·  view source on GitHub ↗
(v, min = 0, max = 100)

Source from the content-addressed store, hash-verified

11};
12
13const clamp = (v, min = 0, max = 100) => Math.min(Math.max(v, min), max);
14const round = (v, precision = 3) => parseFloat(v.toFixed(precision));
15const adjust = (v, fMin, fMax, tMin, tMax) => round(tMin + ((tMax - tMin) * (v - fMin)) / (fMax - fMin));
16

Callers 2

setVarsFromXYFunction · 0.70
ProfileCardComponentFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected