MCPcopy Create free account
hub / github.com/adobe/react-spectrum / getRoundedValue

Function getRoundedValue

packages/react-stately/src/slider/useSliderState.ts:366–368  ·  view source on GitHub ↗
(value: number)

Source from the content-addressed store, hash-verified

364 }
365
366 function getRoundedValue(value: number) {
367 return Math.round((value - minValue) / step) * step + minValue;
368 }
369
370 function getPercentValue(percent: number) {
371 const val = percent * (maxValue - minValue) + minValue;

Callers 1

getPercentValueFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected