GitHub 6521★

Normalize the ratio of a number in a range

JavaScript version

const normalizeRatio = (value, min, max) => (value - min) / (max - min);

TypeScript version

const normalizeRatio = (value: number, min: number, max: number): number => (value - min) / (max - min);
Follow me on and to get more useful contents.