float format
format and compare float number in javascript
API
compare(float1, float2, precision)
if precision is undefined, then use the minimum precision of float1 and float2, else use given precision to compare two numbers
example
const ff = ;; // 0.0402 * 02; // 0.04000000000000001 02 * 02 == 004; // false == 004; // true02 * 02 - 004; // 6.938893903907228e-18 ff; // false, 3.55 != 3.54ff; // true, 4 == 4ff; // false 4.22 != 4