# Buggy code
def decode_number(value):  # type(string) -> (int)
    """
    Decode string to integer and guess correct base
    :param value: string input value
    :return: integer
    """

    value = value.strip()
    base = 10
    if len(value) > 1 and value[1] == "b":  # bin coded
        base = 2
        value = value[2:]
    if len(value) > 1 and value[1] == "x":  # hex coded
        base = 16
        value = value[2:]

    return int(value, base)


# Traceback (ValueError)
Traceback (most recent call last):
File "/home/nostar/.local/bin/canconvert", line 11, in <module>
load_entry_point('canmatrix==0.9.1', 'console_scripts', 'canconvert')()
File "/usr/local/lib/python3.8/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.8/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/home/nostar/.local/lib/python3.8/site-packages/canmatrix/cli/convert.py", line 131, in cli_convert
canmatrix.convert.convert(infile, outfile, **options)
File "/home/nostar/.local/lib/python3.8/site-packages/canmatrix/convert.py", line 40, in convert
dbs = canmatrix.formats.loadp(infile, **options)
File "/home/nostar/.local/lib/python3.8/site-packages/canmatrix/formats/__init__.py", line 77, in loadp
return load(fileObject, import_type, key, **options)
File "/home/nostar/.local/lib/python3.8/site-packages/canmatrix/formats/__init__.py", line 94, in load
dbs = module_instance.load(file_object, **options)  # type: ignore
File "/home/nostar/.local/lib/python3.8/site-packages/canmatrix/formats/arxml.py", line 1723, in load
frame = get_frame(frameTrig, search_point, multiplex_translation, ns, float_factory)
File "/home/nostar/.local/lib/python3.8/site-packages/canmatrix/formats/arxml.py", line 1419, in get_frame
get_signals(pdu_sig_mapping, new_frame, root_or_cache, ns, None, float_factory)
File "/home/nostar/.local/lib/python3.8/site-packages/canmatrix/formats/arxml.py", line 1098, in get_signals
(values, factor, offset, unit_elem, const) = decode_compu_method(compu_method, root_or_cache, ns, float_factory)
File "/home/nostar/.local/lib/python3.8/site-packages/canmatrix/formats/arxml.py", line 921, in decode_compu_method
if ll is not None and desc is not None and canmatrix.utils.decode_number(ul.text) == canmatrix.utils.decode_number(ll.text):
File "/home/nostar/.local/lib/python3.8/site-packages/canmatrix/utils.py", line 106, in decode_number
return int(value, base)
ValueError: invalid literal for int() with base 10: '1023.0'

# Fixed code
def decode_number(value, float_factory):  # type(string) -> (int)
    """
    Decode string to integer and guess correct base
    :param value: string input value
    :return: integer
    """

    value = value.strip()

    if "." in value:
        return float_factory(value)

    base = 10
    if len(value) > 1 and value[1] == "b":  # bin coded
        base = 2
        value = value[2:]
    if len(value) > 1 and value[1] == "x":  # hex coded
        base = 16
        value = value[2:]

    return int(value, base)