Fix human readable time string generation
This commit is contained in:
parent
4ec84a8ff0
commit
6b4de8d6df
1 changed files with 2 additions and 2 deletions
|
@ -4,10 +4,10 @@ private val timeStrings = arrayOf("s", "m", "h", "d")
|
||||||
private val timeDivs = arrayOf(60, 60, 24)
|
private val timeDivs = arrayOf(60, 60, 24)
|
||||||
|
|
||||||
fun <T> humanReadableTimeDelta(time: T): String where T : Number {
|
fun <T> humanReadableTimeDelta(time: T): String where T : Number {
|
||||||
var dbTime = time.toDouble()
|
var dbTime = time.toDouble() / 1000.0
|
||||||
var outString = ""
|
var outString = ""
|
||||||
|
|
||||||
for (i in 0..(timeDivs.size-1)) {
|
for (i in 0..(timeDivs.size - 1)) {
|
||||||
val div = timeDivs[i]
|
val div = timeDivs[i]
|
||||||
val str = timeStrings[i]
|
val str = timeStrings[i]
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue