d2e79501b252ffafa2a25b541f67332c3e186807
- Author
- shun095 <8069181+shun095@users.noreply.github.com>
- Committer
- GitHub <noreply@github.com>
- Date
Message
fix(timer): minutes calculation logic (#12857)
Diff
1diff --git a/plugins/timer/timer.plugin.zsh b/plugins/timer/timer.plugin.zsh
2index d21d59989cf1ee79d27508e7c1579eed968cd410..6baf1f681cd6aa9629aff0713a695ae5fb1dd046 100644
3--- a/plugins/timer/timer.plugin.zsh
4+++ b/plugins/timer/timer.plugin.zsh
5@@ -6,7 +6,7 @@ __timer_current_time() {
6 }
7
8 __timer_format_duration() {
9- local mins=$(printf '%.0f' $(($1 / 60)))
10+ local mins=$(printf '%.0f' $(($(IFS='.' read int dec <<< "$1"; echo $int) / 60)))
11 local secs=$(printf "%.${TIMER_PRECISION:-1}f" $(($1 - 60 * mins)))
12 local duration_str=$(echo "${mins}m${secs}s")
13 local format="${TIMER_FORMAT:-/%d}"