Add rounding direction
This commit is contained in:
@@ -53,7 +53,7 @@ func opI3Status(cmd *cobra.Command, args []string) error {
|
||||
}
|
||||
var text string
|
||||
if wrk.FinishDate.IsZero() {
|
||||
wrkDur := wrk.Duration().Round(time.Minute * 15)
|
||||
wrkDur := util.Round(wrk.Duration())
|
||||
hrs := int(wrkDur.Hours())
|
||||
mins := int(wrkDur.Minutes()) - hrs*60
|
||||
if hrs > 0 {
|
||||
@@ -99,7 +99,7 @@ func opI3Status(cmd *cobra.Command, args []string) error {
|
||||
}
|
||||
total += dur
|
||||
}
|
||||
total = total.Round(util.GetRoundToDuration())
|
||||
total = util.Round(total)
|
||||
if isActive {
|
||||
return fmt.Sprintf("%.2f+", util.DurationToDecimal(total))
|
||||
} else {
|
||||
|
@@ -89,7 +89,7 @@ func opListTimers(cmd *cobra.Command, args []string) error {
|
||||
dayStr = v.StartDate.Format("2006/01/02")
|
||||
if dayStr != oldDayStr {
|
||||
// TODO:
|
||||
wrkDur := dayTotals[dayStr].Round(util.GetRoundToDuration())
|
||||
wrkDur := util.Round(dayTotals[dayStr])
|
||||
fmtStr := dayStr + " ( %.2f )\n"
|
||||
fmt.Printf(fmtStr, util.DurationToDecimal(wrkDur))
|
||||
}
|
||||
|
@@ -44,7 +44,8 @@ func opStatus(cmd *cobra.Command, args []string) error {
|
||||
currDur += v.Duration()
|
||||
}
|
||||
}
|
||||
d := currDur.Round(util.GetRoundToDuration())
|
||||
d := util.Round(currDur)
|
||||
|
||||
fmt.Printf("%s ( %.2f hrs )\n", time.Now().Format(time.Stamp), util.DurationToDecimal(d))
|
||||
for _, v := range *p.TimerList.GetActiveTimers() {
|
||||
fmt.Println(util.TimerToFriendlyString(v))
|
||||
|
@@ -45,7 +45,7 @@ func opShowTimers(cmd *cobra.Command, args []string) error {
|
||||
}
|
||||
total += dur
|
||||
}
|
||||
total = total.Round(util.GetRoundToDuration())
|
||||
total = util.Round(total)
|
||||
if isActive {
|
||||
fmt.Printf("%.2f+\n", util.DurationToDecimal(total))
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user