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

Function getRoundedValue

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

Source from the content-addressed store, hash-verified

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

Callers 1

getPercentValueFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected