diff --git a/pagination/common/src/commonMain/kotlin/dev/inmo/micro_utils/pagination/PaginationResult.kt b/pagination/common/src/commonMain/kotlin/dev/inmo/micro_utils/pagination/PaginationResult.kt index 54cf4a4039e..96bb73b66b0 100644 --- a/pagination/common/src/commonMain/kotlin/dev/inmo/micro_utils/pagination/PaginationResult.kt +++ b/pagination/common/src/commonMain/kotlin/dev/inmo/micro_utils/pagination/PaginationResult.kt @@ -1,6 +1,6 @@ package dev.inmo.micro_utils.pagination -import kotlinx.serialization.Serializable +import kotlinx.serialization.* import kotlin.math.ceil @Serializable @@ -10,6 +10,7 @@ data class PaginationResult( val results: List, val objectsCount: Long ) : Pagination { + @EncodeDefault val pagesNumber: Int = ceil(objectsCount / size.toFloat()).toInt() constructor(