File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
utbot-core/src/main/kotlin/org/utbot/common Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -224,13 +224,16 @@ object FileUtil {
224
224
}
225
225
226
226
// https://stackoverflow.com/a/68822715
227
- fun byteCountToDisplaySize (bytes : Long ): String =
228
- when {
229
- bytes >= 1 shl 30 -> " %.1f GB" .format(bytes / (1 shl 30 ))
230
- bytes >= 1 shl 20 -> " %.1f MB" .format(bytes / (1 shl 20 ))
231
- bytes >= 1 shl 10 -> " %.0f kB" .format(bytes / (1 shl 10 ))
232
- else -> " $bytes bytes"
227
+ fun byteCountToDisplaySize (bytes : Long ): String {
228
+ val bytesInDouble = bytes.toDouble()
229
+
230
+ return when {
231
+ bytesInDouble >= 1 shl 30 -> " %.1f GB" .format(bytesInDouble / (1 shl 30 ))
232
+ bytesInDouble >= 1 shl 20 -> " %.1f MB" .format(bytesInDouble / (1 shl 20 ))
233
+ bytesInDouble >= 1 shl 10 -> " %.0f kB" .format(bytesInDouble / (1 shl 10 ))
234
+ else -> " $bytesInDouble bytes"
233
235
}
236
+ }
234
237
}
235
238
236
239
/* *
You can’t perform that action at this time.
0 commit comments