round

open fun round(@Nullable num: Double, thDigits: Int): Double
open fun round(@Nullable num: Float, thDigits: Int): Float

Round a number to a certain number of decimal points.

Return

The rounded number, or 0 if the number is null

Parameters

num

The number to round

thDigits

The number of decimal places to use after the decimal point


open fun round(@Nullable num: Float, thDigits: Int, sigFigs: Int): Float

Round a number to a certain number of decimal points.

Return

The rounded number, or 0 if the number is null

Parameters

num

The number to round

thDigits

The number of decimal places to use after the decimal point

sigFigs

The number of significant figures to use


open fun round(@Nullable num: Double, thDigits: Int, sigFigs: 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

num

The number to round

thDigits

The number of decimal places to use after the decimal point

sigFigs

The number of significant figures to use