File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
core/common/src/main/java/com/example/util/simpletimetracker/core/mapper Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -493,7 +493,7 @@ class TimeMapper @Inject constructor(
493493 )
494494
495495 if (useProportionalMinutes) {
496- return formatIntervalProportional(hr, min)
496+ return formatIntervalProportional(interval, hr, min)
497497 }
498498
499499 val willShowHours: Boolean
@@ -557,13 +557,15 @@ class TimeMapper @Inject constructor(
557557 }
558558 }
559559
560- private fun formatIntervalProportional (hr : Long , min : Long ): String {
560+ private fun formatIntervalProportional (interval : Long , hr : Long , min : Long ): String {
561561 val hourString = resourceRepo.getString(R .string.time_hour)
562562 val minutesProportion = min / 60f
563563 val proportional = hr + minutesProportion
564564 val proportionalString = " %.2f" .format(proportional)
565565
566- return " $proportionalString$hourString "
566+ val res = " $proportionalString$hourString "
567+
568+ return if (interval < 0 ) " -$res " else res
567569 }
568570
569571 fun toDayDateTitle (
You can’t perform that action at this time.
0 commit comments