Skip to content

Commit

Permalink
修复与倒数日实际距离为 *.9999 天时,显示与倒数日距离为"*1.000"的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
STBBRD committed Apr 27, 2024
1 parent 81f0cef commit e6289e0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ZongziTEK_Blackboard_Sticker/Pages/CountdownPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ private void Timer_Tick(object sender, EventArgs e)
if (timeSpan.TotalDays < 0)
{
LabelDays.Foreground = new SolidColorBrush(Color.FromArgb(255, 0, 204, 0));
LabelName.Content = countdownName + "已开始";
LabelName.Content = "距离" + countdownName + "开始已过去";
timeSpan = -timeSpan;
}
else
Expand All @@ -53,7 +53,7 @@ private void Timer_Tick(object sender, EventArgs e)
LabelName.Content = "距离" + countdownName + "还有";
}
LabelDays.Content = timeSpan.Days;
LabelDaysDetail.Content = (timeSpan.TotalDays - timeSpan.Days).ToString(".000");
LabelDaysDetail.Content = "." + Math.Truncate((timeSpan.TotalDays - timeSpan.Days) * 1000).ToString("000");
}

private void Page_Unloaded(object sender, EventArgs e)
Expand Down

0 comments on commit e6289e0

Please sign in to comment.