zeroable
v0.0.1
Published
NaN = 0, customizable and flex, any falsy value to zero.
Downloads
1
Readme
NaN = 0, it should be.
Faster than Number,parseInt, and parseFloat.
Wrapped to make it look clean.
npm install zeroable
ES6
import zeroable from "zeroable";
console.log(zeroable("SSSS")); // returns 0
console.log(zeroable("11.1")); // returns 11.1
console.log(zeroable()); // returns 0
CJS
const zeroable = require("zeroable");
console.log(zeroable("SSSS")); // returns 0
console.log(zeroable("11.1")); // returns 11.1
console.log(zeroable()); // returns 0
This library using MIT License