Skip to content

Commit

Permalink
replace repeat() with pow() (#177)
Browse files Browse the repository at this point in the history
  • Loading branch information
hamoid authored Mar 6, 2021
1 parent 714969e commit c43e6c6
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,6 @@ fun XYPad.bind(property: KMutableProperty0<Vector2>) {
}

fun Double.round(decimals: Int): Double {
var multiplier = 1.0
repeat(decimals) { multiplier *= 10 }
val multiplier = 10.0.pow(decimals)
return round(this * multiplier) / multiplier
}

0 comments on commit c43e6c6

Please sign in to comment.