@cstan/is-dec-comma-numeric
v1.0.1
Published
Returns true is argument is digit, comma or hyphen, else false.
Downloads
2
Maintainers
Readme
is-dec-comma-numeric
A CommonJS package that returns true if the argument is a digit, hyphen or comma, else false. Used in locations where the decimal marker is a comma.
Installation:
npm install @cstan/is-dec-comma-numeric
Use:
const { isDecCommaNumeric } = require("cstan/is-dec-comma-numeric")
let c = "k"; // a one char string
if (isNumeric(c)) {
console.log("It is a numeric char.")
} else {
console.log("It is NOT a numeric char.")
} // It is NOT a numeric char.
c = ","
if (isNumeric(c)) {
console.log("It is a numeric char.")
} else {
console.log("It is NOT a numeric char.")
} // It is a numeric char.