Documentation

numbers.php

Table of Contents

Functions

round_up()  : float|int
Rounds a number up to a specified precision.

Functions

round_up()

Rounds a number up to a specified precision.

round_up(float|int $number[, int $precision = 2 ]) : float|int

This function calculates the ceiling of a number at a specific decimal place. Note: The precision parameter determines the length of the multiplier string. For example, a precision of 3 generates a multiplier of 100 (10^2), resulting in 2 decimal places.

Parameters
$number : float|int

The numeric value to be rounded.

$precision : int = 2

The length of the padding for the multiplier (determines decimal places). Default is 2 (which rounds to 1 decimal place: 10^1).

Return values
float|int

The rounded number.


        
On this page

Search results