round

fun Number?.round(thDigits: Int, sigFigs: Int = -1): Double

Round a number to a certain number of decimal points.

Return

The rounded number, or 0 if the number is null, or 0 if the number is null

Parameters

thDigits

The number of decimal places to use after the decimal point

sigFigs

The number of significant figures to use


@JvmName(name = "roundInfix")
infix fun Number?.round(thDigits: Int): Double

Round a number to a certain number of decimal points.

Return

The rounded number, or 0 if the number is null, or 0 if the number is null

Parameters

thDigits

The number of decimal places to use after the decimal point