Skip to content

Commit

Permalink
Fixed milliseconds on times being truncated instead of rounded
Browse files Browse the repository at this point in the history
  • Loading branch information
milankarman committed Jul 4, 2021
1 parent 7f42824 commit eb57b1f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Unload.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.31205.134
# Visual Studio Version 17
VisualStudioVersion = 17.0.31423.177
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Unload", "Unload\Unload.csproj", "{A056324E-0389-471E-ACF5-A133B23F8FEB}"
EndProject
Expand Down
8 changes: 4 additions & 4 deletions Unload/src/windows/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -491,9 +491,9 @@ private string GetTotalTimeString()
}

double totalSecondsDouble = totalFrames / framesPerSecond;
TimeSpan timeWithoutLoads = TimeSpan.FromSeconds(totalSecondsDouble);
TimeSpan timeWithoutLoads = TimeSpan.FromSeconds(Math.Round(totalSecondsDouble, 3));

return $"{timeWithoutLoads:hh\\:mm\\:ss\\:fff}";
return $"{timeWithoutLoads:hh\\:mm\\:ss\\.fff}";
}

// Verifies user input is correct and returns the loadless time formatted as a string
Expand All @@ -519,9 +519,9 @@ private string GetLoadlessTimeString()

int loadlessFrames = totalFrames - int.Parse(txtLoadFrames.Text);
double loadlessSecondsDouble = loadlessFrames / framesPerSecond;
TimeSpan timeWithoutLoads = TimeSpan.FromSeconds(loadlessSecondsDouble);
TimeSpan timeWithoutLoads = TimeSpan.FromSeconds(Math.Round(loadlessSecondsDouble, 3));

return $"{timeWithoutLoads:hh\\:mm\\:ss\\:fff}";
return $"{timeWithoutLoads:hh\\:mm\\:ss\\.fff}";
}

// Checks if all required fields for frame counting are filled in
Expand Down

0 comments on commit eb57b1f

Please sign in to comment.