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

Function getRoundedValue

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

Source from the content-addressed store, hash-verified

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

Callers 1

getPercentValueFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected