Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
workaholicpanda committed Sep 11, 2021
1 parent af77a4c commit 3ec545a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,10 @@ export function ensureValueInRange(val: number, { max, min }: { max?: number; mi
}

export function ensureValuePrecision(val: number, props) {
const { step } = props;
const { step, min, max } = props;
const closestPoint = isFinite(getClosestPoint(val, props)) ? getClosestPoint(val, props) : 0; // eslint-disable-line
return step === null ? closestPoint : parseFloat(closestPoint.toFixed(getPrecision(step)));
const retValue = step === null ? closestPoint : parseFloat(closestPoint.toFixed(getPrecision(step)));
return Math.min(Math.max(retValue, min), max);
}

export function pauseEvent(e: React.SyntheticEvent) {
Expand Down

0 comments on commit 3ec545a

Please sign in to comment.