def format_timedelta_pretty(seconds: float) -> str:
    """Format a float representing seconds into a string.

    Args:
      seconds: result of a time.time() - time.time().

    Returns:
        Pretty formatted string according to specification.
    """
    int_seconds = int(seconds)
    days, int_seconds = divmod(int_seconds, 86400)
    hours, int_seconds = divmod(int_seconds, 3600)
    minutes, int_seconds = divmod(int_seconds, 60)
    if days > 0:
        return "%dd%dh%dm%ds" % (days, hours, minutes, int_seconds)
    elif hours > 0:
        return "%dh%dm%ds" % (hours, minutes, int_seconds)
    elif minutes > 0:
        return "%dm%ds" % (minutes, int_seconds)
    else:
        return f"{seconds:.3f}s"