@cstan/only-digits
v1.0.1
Published
Filters out all non-digit characters from a string
Downloads
1
Readme
@cstan/only-digits
A CommonJS package that filters out all non-digit characters from a string.
Installation:
npm install @cstan/only-digits
Use:
const { onlyDigits } = require("cstan/only-digits")
let s = "$USD 1,234.56";
let d = onlyDigits(s);
console.log(`Number is: ${d}`);
// Number is: 123456