import math


def fixed_width_text(text, char_num=10):
    """Add linebreaks every char_num characters in a given text.

    Parameters
    ----------
    text: obj:'str'
        text to apply the linebreaks
    char_num: obj:'int'
        max number of characters in a line before a line break
        Default: 10
    Returns
    -------
    obj:'str'
        the text with line breaks after every char_num characters

    Examples
    --------
    >>> fixed_width_text("12345", char_num=2)
    '12\\n34\\n5'
    >>> fixed_width_text("123456")
    '123456'
    >>> fixed_width_text("12345", 5)
    '12345'
    >>> fixed_width_text("", 2)
    ''
    """
    # integer number of lines of `char_num` character
    n_lines = math.ceil(len(text) / char_num)

    # split the text in lines of `char_num` character
    split_text = []
    for i in range(n_lines):
        split_text.append(text[(i * char_num):((i + 1) * char_num)])

    return "\n".join(split_text)