I have the following code to round a value to any nearest number:
func round(_ value: Double, toNearest nearest: Double) -> Double {
let roundedValue = round(value / nearest) * nearest
return roundedValue
}
However, I get the following complaint because I use the same name for this method as the builtin one:
Missing argument for parameter 'toNearest' in call
Is there a way to get around this? i.e. builtin round(value / nearest)
?
Thanks.