← All docs

bcround()

Rounds an arbitrary-precision decimal number.

bcround()

function bcround(string $num, int $precision = 0, int $mode = 1): string

Rounds an arbitrary-precision decimal number.

Parameters:

  • $num (string)
  • $precision (int), default 0, optional
  • $mode (int), default 1, optional

Returns: string

Availability

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

Internals

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