Skip to main content

function

round

round[T: Roundable](value: T) -> $0

Get the rounded value of the given object.

Parameters:

  • T (Roundable): The type conforming to Roundable.

Args:

  • value (T): The object to get the rounded value of.

Returns:

The rounded value of the object.

round[T: Roundable](value: T, ndigits: Int) -> $0

Get the rounded value of the given object.

Parameters:

  • T (Roundable): The type conforming to Roundable.

Args:

  • value (T): The object to get the rounded value of.
  • ndigits (Int): The number of digits to round to.

Returns:

The rounded value of the object.