Spaces:
Sleeping
Sleeping
| 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 | |