Scales a number within a range.
https://www.npmjs.com/package/@pelevesque/scale-number
npm install @pelevesque/scale-number
Command | Description |
---|---|
npm test or npm run test |
All Tests Below |
npm run cover |
Standard Style |
npm run standard |
Coverage |
npm run unit |
Unit Tests |
const scaleNumber = require('@pelevesque/scale-number')
const num = 10
const oldRangeMin = 0
const oldRangeMax = 100
const newRangeMin = 0
const newRangeMax = 1000
const result = scaleNumber(num, oldRangeMin, oldRangeMax, newRangeMin, newRangeMax)
// result === 100