Package-level declarations

Functions

Link copied to clipboard
Link copied to clipboard
fun Double.format(digits: Int): String

Formats the Double to a string with a specified number of decimal digits, using a period (.) as the decimal separator. Example: 3.14159.format(2) -> "3.14"

fun Float.format(digits: Int): String

Formats the Float to a string with a specified number of decimal digits, using a period (.) as the decimal separator. Example: 3.14159f.format(2) -> "3.14"

Link copied to clipboard
fun Float.roundTo(decimalPlaces: Int): Float

Rounds the Float to a specified number of decimal places. Uses RoundingMode.HALF_UP.