← All docs

round()

Rounds a float.

round()

function round(float $num, int $precision = 0): float

Rounds a float.

Parameters:

  • $num (float)
  • $precision (int), default 0, optional

Returns: float

No examples yet — check examples/ and showcases/ for usage patterns.

Internals

For how round is implemented in the compiler, see the internals page.