diff --git a/time-android/src/main/kotlin/com/kizitonwose/timeandroid/AndroidExtensions.kt b/time-android/src/main/kotlin/com/kizitonwose/timeandroid/AndroidExtensions.kt index fb83766..edf3b4d 100644 --- a/time-android/src/main/kotlin/com/kizitonwose/timeandroid/AndroidExtensions.kt +++ b/time-android/src/main/kotlin/com/kizitonwose/timeandroid/AndroidExtensions.kt @@ -1,3 +1,4 @@ +@file:Suppress("unused") package com.kizitonwose.timeandroid import android.os.Handler diff --git a/time/src/main/kotlin/com/kizitonwose/time/Extensions.kt b/time/src/main/kotlin/com/kizitonwose/time/Extensions.kt index 9f45f39..b9063df 100644 --- a/time/src/main/kotlin/com/kizitonwose/time/Extensions.kt +++ b/time/src/main/kotlin/com/kizitonwose/time/Extensions.kt @@ -1,3 +1,4 @@ +@file:Suppress("unused") package com.kizitonwose.time import java.util.* diff --git a/time/src/main/kotlin/com/kizitonwose/time/Time.kt b/time/src/main/kotlin/com/kizitonwose/time/Time.kt index e4d950c..0443d58 100644 --- a/time/src/main/kotlin/com/kizitonwose/time/Time.kt +++ b/time/src/main/kotlin/com/kizitonwose/time/Time.kt @@ -1,6 +1,8 @@ package com.kizitonwose.time import java.io.Serializable +import java.util.* +import kotlin.math.roundToLong /** * Created by Kizito Nwose on 14/10/2017 @@ -27,7 +29,7 @@ class Interval(value: Number, factory: () -> T) : Serializable val value = value.toDouble() - val longValue = Math.round(this.value) + val longValue = this.value.roundToLong() val inDays: Interval get() = converted() @@ -90,7 +92,7 @@ class Interval(value: Number, factory: () -> T) : Serializable override fun hashCode() = inMilliseconds.value.hashCode() override fun toString(): String { - val unitString = unit::class.java.simpleName.toLowerCase() + val unitString = unit::class.java.simpleName.toLowerCase(Locale.ENGLISH) val isWhole = value % 1 == 0.0 return (if (isWhole) longValue.toString() else value.toString()) .plus(" ")