fun Number?.safeDiv(divisions: Number?, default: Double=0.0): Double { val value = divisions?.toDouble() ?: 0.0 if (value == 0.0) { return default } return ((this?.toDouble() ?: 0.0) / value) }