2.0.2 • Published 9 years ago
get-value-in-range v2.0.2
get-value-in-range
Calculate range adjusted values
getValueInRange(value, values) ⇒ number
Find the position of the value within a range where 0 is the minimum value and 1 is the maximum value.
Kind: global function
Returns: number - The position of the value within the range
| Param | Type | Description |
|---|---|---|
| value | number | The value to place within the range |
| values | number | All of the values necessary to calculate the range |
Example
getValueInRange(7.5, [10, 5]);
// → 0.5Scripts
test – run the tests
npm run testlint – lint the codebase
npm run lintreadme – generate the README
npm run readmeLicense
MIT @ Flip