def string_to_number(word):
    """ Converts from number(string) to number(integer)
        Args:
            word (`str`): number (string)
        Raise:
            Exception
        Returns:
            ret_num ('int|float'): number (integer|float)

        Example:

        >>> dev.api.string_to_number('1')
        1

        >>> dev.api.string_to_number('1.1')
        1.1

    """
    try:
        ret_num = int(word)
    except Exception:
        try:
            ret_num = float(word)
        except Exception:
            raise Exception(
                "'{word}' could not be converted to number.".format(word=word))

    return ret_num