orZero

inline fun <T : Number> T?.orZero(): Number

Returns this number if it's not null, or 0 otherwise.

This is a concise alternative to the Elvis expression this ?: 0.