Check if two floats are almost equal
Due to rounding errors you shouldn't compare floats directly. Instead this module takes an upperbound for rounding errors into consideration.
$ npm install --save float-equal
var floatEqual = require('float-equal');
console.log(0.1 + 0.2 === 0.3);
//=> false
console.log(floatEqual(0.1 + 0.2, 0.3));
//=> true
MIT © Sindre Sorhus