File size: 361 Bytes
bf09265
 
 
 
 
 
1
2
3
4
5
6
7
def format_post_row(post_id: int, wins: int, losses: int, label: str | None = None) -> str:
    total = wins + losses
    win_pct = f"{(100.0 * wins / total):.1f}%" if total > 0 else "-"
    url = f"https://e621.net/posts/{post_id}"
    row = f"{url} | Wins: {wins} | Losses: {losses} | Win percentage: {win_pct}"
    return f"{label}: {row}" if label else row