src/helpers/roundToStepRatio.js
function roundToStepRatio (value, stepRatio) {
  const stepRatioDecimals = calculateDecimals(stepRatio);
  const stepDecimalsMultiplier = Math.pow(10, stepRatioDecimals);

  value = Math.round(value / stepRatio) * stepRatio;

  return Math.round(value * stepDecimalsMultiplier) / stepDecimalsMultiplier;
}
function roundToStepRatio (value, stepRatio) {
  const stepRatioDecimals = calculateDecimals(stepRatio);
  const stepDecimalsMultiplier = Math.pow(10, stepRatioDecimals);

  value = Math.round(value / stepRatio) * stepRatio;

  return Math.round(value * stepDecimalsMultiplier) / stepDecimalsMultiplier;
}
function roundToStepRatio ( value , stepRatio ) { const stepRatioDecimals = calculateDecimals ( stepRatio ) ; const stepDecimalsMultiplier = Math . pow ( 10 , stepRatioDecimals ) ; value = Math . round ( value / stepRatio ) * stepRatio ; return Math . round ( value * stepDecimalsMultiplier ) / stepDecimalsMultiplier ; }
Rounds value to step ratio
Rounds value to step ratio