this package lets you to extract number from any string
Installation
npm i numExtracter
Then...
import {useNumExtracter} from 'num-extracter'
const number = useNumExtracter();
<!-- pass string from which number is to be extracted to -->
number(string)