Skip to content

Commit 3e6609a

Browse files
authored
CASL-788 random test fail fix - roundToDecimal (#400)
1 parent 832f362 commit 3e6609a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

here-naksha-lib-psql/src/commonTest/kotlin/naksha/psql/util/ProxyFeatureGenerator.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,10 @@ object ProxyFeatureGenerator {
9595
}
9696

9797
private fun Double.roundToDecimal(decimals: Int): Double {
98-
var dotAt = 1
98+
var dotAt = 1.0
9999
repeat(decimals) { dotAt *= 10 }
100100
val roundedValue = (this * dotAt).roundToInt()
101-
return (roundedValue / dotAt) + (roundedValue % dotAt).toDouble() / dotAt
101+
return roundedValue / dotAt
102102
}
103103

104104
private val adverbs: Array<String> = arrayOf(

0 commit comments

Comments
 (0)