from typing import Optional


def _default_progress_str(progress: int, total: Optional[int], final: bool):
    """
    Default progress string

    Args:
        progress: The progress so far as an integer.
        total: The total progress.
        final: Whether this is the final call.

    Returns:
        A formatted string representing the progress so far.
    """
    prefix = "completed " if final else ""
    if total is not None:
        percent = (100.0 * progress) / total
        return "%s%d / %d (%3d%%)" % (prefix, progress, total, int(percent))
    else:
        return "%s%d / %d" % (prefix, progress, progress)