Function changeDelimitation

  • Processes a string input by removing non-numeric characters, then calls the provided onChange callback with a formatted numeric string. If the input has no valid numbers, an empty string is passed to onChange.

    Parameters

    • value: string

      The input string that may contain non-numeric characters.

    • onChange: (value: string) => void

      A callback function that receives the processed string.

    Returns void

    ChangeDelimitation("12,345", (result) => {
    console.log(result); // "12,345" (formatted by convertToTypeSafeString)
    });
    ChangeDelimitation("abc", (result) => {
    console.log(result); // ""
    });