Score

class Score(source)

This is the primary way to store score/rating. Use Score.from or Score.from10 to parse the score as it does not have a public constructor. Use toInt/toFloat to get back the score.

Internally it stores it as an int up to 10^9 to represent up to 10 significant digits. So think of this as a decimal class specifically for ratings.

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
fun toByte(maxScore: Int): Byte
Link copied to clipboard
fun toDouble(maxScore: Int = 10): Double
Link copied to clipboard
fun toFloat(maxScore: Int = 10): Float
Link copied to clipboard
fun toInt(maxScore: Int = 10): Int
Link copied to clipboard
fun toLong(maxScore: Int = 10): Long
Link copied to clipboard
fun toOld(): Int
Link copied to clipboard
open override fun toString(): String

fun toString(maxScore: Int, decimals: Int = 1, removeTrailingZeros: Boolean = true, decimalChar: Char = '.'): String

Formats the rating to a human readable format (with no rounding)

Link copied to clipboard
fun toStringNull(minScore: Double, maxScore: Int, decimals: Int = 1, removeTrailingZeros: Boolean = true, decimalChar: Char = '.'): String?

Formats the rating to a human readable format (with no rounding)