From 16b614d6f3fcc88924e79ac3a1bffef538b09e8b Mon Sep 17 00:00:00 2001 From: Iván Ávalos Date: Sun, 16 Jan 2022 16:11:47 -0600 Subject: Added hourmeter field --- .../commonMain/kotlin/mx/trackermap/TrackerMap/utils/Formatter.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'shared') diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/utils/Formatter.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/utils/Formatter.kt index 878418e..c113bef 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/utils/Formatter.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/utils/Formatter.kt @@ -1,7 +1,6 @@ package mx.trackermap.TrackerMap.utils import kotlinx.datetime.* -import kotlin.math.round class Formatter { companion object { @@ -25,5 +24,9 @@ class Formatter { } } } + + fun formatHours(millis: Long): String { + return "${millis / (1000 * 60 * 60)} hr" + } } } \ No newline at end of file -- cgit v1.2.3