@cstan/only-digits
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

@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

/@cstan/only-digits/

    Package Sidebar

    Install

    npm i @cstan/only-digits

    Weekly Downloads

    0

    Version

    1.0.1

    License

    ISC

    Unpacked Size

    1.28 kB

    Total Files

    4

    Last publish

    Collaborators

    • cstanton48