0.0.1 • Published 3 years ago
zeroable v0.0.1
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
0.0.1
3 years ago