Skip to content

Commit

Permalink
fix: Remove unnecessary conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
F1bonacc1 committed Dec 20, 2024
1 parent ad61f77 commit 7317c7b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app/pc_string.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ func HumanDuration(d time.Duration) string {
} else if hours < 24*365*2 {
return fmt.Sprintf("%dd", hours/24)
} else if hours < 24*365*8 {
dy := int(hours/24) % 365
dy := hours / 24 % 365
if dy == 0 {
return fmt.Sprintf("%dy", hours/24/365)
}
return fmt.Sprintf("%dy%dd", hours/24/365, dy)
}
return fmt.Sprintf("%dy", int(hours/24/365))
return fmt.Sprintf("%dy", hours/24/365)
}

0 comments on commit 7317c7b

Please sign in to comment.