From 6c36a3244f205db3fc1be3ea8d3eed6a30860dd0 Mon Sep 17 00:00:00 2001 From: Davide Depau Date: Tue, 14 Aug 2018 19:08:33 +0200 Subject: [PATCH] Fix human readable time string generation --- app/src/main/java/eu/depau/ddroid/utils/NumberToTimeString.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/depau/ddroid/utils/NumberToTimeString.kt b/app/src/main/java/eu/depau/ddroid/utils/NumberToTimeString.kt index 70faf20..3413b6d 100644 --- a/app/src/main/java/eu/depau/ddroid/utils/NumberToTimeString.kt +++ b/app/src/main/java/eu/depau/ddroid/utils/NumberToTimeString.kt @@ -4,10 +4,10 @@ private val timeStrings = arrayOf("s", "m", "h", "d") private val timeDivs = arrayOf(60, 60, 24) fun humanReadableTimeDelta(time: T): String where T : Number { - var dbTime = time.toDouble() + var dbTime = time.toDouble() / 1000.0 var outString = "" - for (i in 0..(timeDivs.size-1)) { + for (i in 0..(timeDivs.size - 1)) { val div = timeDivs[i] val str = timeStrings[i]