Skip to content

Commit

Permalink
Calculate hours from days and hours instead TotalHours to avoid rounding
Browse files Browse the repository at this point in the history
  • Loading branch information
Sawair committed Feb 12, 2020
1 parent 5df0577 commit 3f34e59
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion DailyStatus.UI/ViewModel/StatusViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public string StatusString
{
var sign = "-";
sign = Diff.TotalHours < 0 ? sign : "";
return $"{sign}{Math.Abs(Diff.TotalHours):0}:{Math.Abs(Diff.Minutes):00}";
return $"{sign}{Math.Abs(Diff.Days * 24 + Diff.Hours):0}:{Math.Abs(Diff.Minutes):00}";
}
else
{
Expand Down

0 comments on commit 3f34e59

Please sign in to comment.