is-within
Simple tool for testing if a given input is within a threshold of a target.
example
var isWithin = ; var input = 5;var target = 6;var threshold = 2;var thresholdZero = 0; ; // -> true; // -> false
isWithin(input, target, threshold)
input
- the number you want to testtarget
- the target numberthreshold
- how much tolerance +/- from the target to allow
installation
npm install is-within
test
npm test
licence
MIT