2020-09-12 05:12:13 +02:00
|
|
|
package exh.util
|
|
|
|
|
|
2020-10-28 00:52:32 +01:00
|
|
|
import kotlin.math.floor
|
2020-09-12 05:12:13 +02:00
|
|
|
|
2020-10-28 00:52:32 +01:00
|
|
|
fun Float.floor(): Int = floor(this).toInt()
|
|
|
|
|
|
|
|
|
|
fun Double.floor(): Int = floor(this).toInt()
|
|
|
|
|
|
2021-02-24 22:16:47 +01:00
|
|
|
fun Int.nullIfZero() = takeUnless { it == 0 }
|
2020-10-28 00:52:32 +01:00
|
|
|
|
2021-02-24 22:16:47 +01:00
|
|
|
fun Long.nullIfZero() = takeUnless { it == 0L }
|