Skip to content

Commit

Permalink
minor formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Szer committed Oct 4, 2023
1 parent e41470c commit 7ed0505
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/VahterBanBot/Types.fs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ type VahterStats =
|> Array.filter (fun x -> x.KillCountInterval > 0)

if intervalKills.Length > 0 then
%sb.AppendLine $"Vahter stats for the last {timeSpanAsHumanReadable this.interval.Value}"
%sb.AppendLine $"Vahter stats for the last {timeSpanAsHumanReadable this.interval.Value}:"

intervalKills
|> Array.sortByDescending (fun x -> x.KillCountInterval)
Expand All @@ -87,7 +87,7 @@ type VahterStats =
else
%sb.AppendLine $"No one was killed in the last {timeSpanAsHumanReadable this.interval.Value}"

%sb.AppendLine "Vahter stats all time"
%sb.AppendLine "Vahter stats all time:"
this.stats
|> Array.sortByDescending (fun x -> x.KillCountTotal)
|> Array.iteri (fun i stat ->
Expand Down
8 changes: 4 additions & 4 deletions src/VahterBanBot/Utils.fs
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ let prependUsername (s: string) =
let timeSpanAsHumanReadable (ts: TimeSpan) =
let totalSeconds = ts.TotalSeconds
if totalSeconds < 60.0 then
$"%.1f{totalSeconds} seconds"
$"%.0f{totalSeconds} seconds"
elif totalSeconds < 3600.0 then
$"%.1f{ts.TotalMinutes} minutes"
$"%.0f{ts.TotalMinutes} minutes"
elif totalSeconds < 86400.0 then
$"%.1f{ts.TotalHours} hours"
$"%.0f{ts.TotalHours} hours"
else
$"%.1f{ts.TotalDays} days"
$"%.0f{ts.TotalDays} days"

0 comments on commit 7ed0505

Please sign in to comment.