@file:Suppress("NOTHING_TO_INLINE")

package com.livinglifetechway.k4kotlin

/**
 * Returns Zero (0) if it is null
 */
fun Number?.orZero(): Number = if (this != null) this else 0

fun Int?.orZero(): Int = if (this != null) this else 0

fun Long?.orZero(): Long = if (this != null) this else 0

fun Float?.orZero(): Float = if (this != null) this else 0.0f

fun Double?.orZero(): Double = if (this != null) this else 0.0

@file:Suppress("NOTHING_TO_INLINE")

package com.livinglifetechway.k4kotlin

/**
 * Returns Zero (0) if it is null
 */
fun Number?.orZero(): Number = this ?: 0

fun Int?.orZero(): Int = this ?: 0

fun Long?.orZero(): Long = this ?: 0

fun Float?.orZero(): Float = this ?: 0.0f

fun Double?.orZero(): Double = this ?: 0.0

Replace null checks with elvis expression
Replace null checks with elvis expression

kirtan403/K4Kotlin,kirtan403/K4Kotlin