Use a descriptive function name
This commit is contained in:
parent
8aee6c560b
commit
8142489d87
2 changed files with 4 additions and 4 deletions
|
|
@ -3,6 +3,6 @@ package com.simplemobiletools.smsmessenger.extensions
|
|||
import kotlin.math.roundToInt
|
||||
|
||||
/**
|
||||
* Returns the closest next number divisible by [multipleOf].
|
||||
* Returns the closest number divisible by [multipleOf].
|
||||
*/
|
||||
fun Int.round(multipleOf: Int = 1) = (toDouble() / multipleOf).roundToInt() * multipleOf
|
||||
fun Int.roundToClosestMultipleOf(multipleOf: Int = 1) = (toDouble() / multipleOf).roundToInt() * multipleOf
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue