Created
August 30, 2023 22:39
-
-
Save xdevs23/6f490e1b4bb85acfb8cf779ae892d029 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val values = listOf(8988, -4412, 597, -1624, 597, -514, 597, -514, 597, -514, 597, -513, 597, -514, 597, -514, 597, -514, 600, -511, 597, -1624, 597, -1625, 597, -1625, 597, -1625, 597, -1625, 596, -1626, 596, -1625, 598, -1625, 597, -1625, 597, -1625, 597, -1625, 597, -514, 597, -514, 597, -514, 597, -515, 597, -514, 597, -514, 597, -514, 597, -514, 597, -1625, 597, -1625, 597, -1625, 597, -1625, 597, -1625, 597, -1625, 597, -1626, 599, -1623, 597, -514, 597, -514, 597, -514, 597, -514, 597, -514, 597, -514, 597, -514, 597, -514, 597, -1626, 597, -1625, 597, -1625, 596, -1626, 596) | |
val roundedValues = values.map { it.toFloat() / 100f }.map { it + (if (it < 0f) -0.5f else .5f) }.map { it.toInt() * 100 } | |
roundedValues.chunked(2).joinToString("") { "${it.joinToString(", ")},\n" } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment