Function delimitator

  • Removes all non-numeric characters from a string and converts it to a number.

    Parameters

    • value: string

      The input string that may contain non-numeric characters.

    Returns number

    The numeric value extracted from the string as a number.

    const result = delimitator("12,345");
    console.log(result); // 12345
    const result = delimitator("$99.99");
    console.log(result); // 9999