import re


def number_2int(kv_format, str_value):
    """
    kv_format for number is usually something like this:

        dddd
        d,ddd
        d.ddd

    So converting to an integer means just remove from string
    non-numeric characters and cast remaining str to integer.
    """
    if str_value:
        line = re.sub(r'[\,\.]', '', str_value)
        return line

    return 0