Moodle PHP Documentation 5.1
Moodle 5.1dev (Build: 20250711) (9addea9f0ac)
PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Round Class Reference

Static Public Member Functions

static down ($number, $digits)
 ROUNDDOWN.
 
static even ($number)
 EVEN.
 
static multiple (mixed $number, mixed $multiple)
 MROUND.
 
static odd ($number)
 ODD.
 
static round (mixed $number, mixed $precision)
 
static up ($number, $digits)
 ROUNDUP.
 

Member Function Documentation

◆ down()

static PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Round::down ( $number,
$digits )
static

ROUNDDOWN.

Rounds a number down to a specified number of decimal places

Parameters
null | array | float | string$numberNumber to round, or can be an array of numbers
array | float | int | string$digitsNumber of digits to which you want to round $number, or can be an array of numbers
Return values
array|float|stringRounded Number, or a string containing an error If an array of numbers is passed as the argument, then the returned result will also be an array with the same dimensions

◆ even()

static PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Round::even ( $number)
static

EVEN.

Returns number rounded up to the nearest even integer. You can use this function for processing items that come in twos. For example, a packing crate accepts rows of one or two items. The crate is full when the number of items, rounded up to the nearest two, matches the crate's capacity.

Excel Function: EVEN(number)

Parameters
array | float$numberNumber to round, or can be an array of numbers
Return values
array|float|stringRounded Number, or a string containing an error If an array of numbers is passed as the argument, then the returned result will also be an array with the same dimensions

◆ multiple()

static PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Round::multiple ( mixed $number,
mixed $multiple )
static

MROUND.

Rounds a number to the nearest multiple of a specified value

Parameters
mixed$numberExpect float. Number to round, or can be an array of numbers
mixed$multipleExpect int. Multiple to which you want to round, or can be an array of numbers.
Return values
array|float|int|stringRounded Number, or a string containing an error If an array of numbers is passed as the argument, then the returned result will also be an array with the same dimensions

◆ odd()

static PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Round::odd ( $number)
static

ODD.

Returns number rounded up to the nearest odd integer.

Parameters
array | float$numberNumber to round, or can be an array of numbers
Return values
array|float|int|stringRounded Number, or a string containing an error If an array of numbers is passed as the argument, then the returned result will also be an array with the same dimensions

◆ up()

static PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Round::up ( $number,
$digits )
static

ROUNDUP.

Rounds a number up to a specified number of decimal places

Parameters
array | float$numberNumber to round, or can be an array of numbers
array | int$digitsNumber of digits to which you want to round $number, or can be an array of numbers
Return values
array|float|stringRounded Number, or a string containing an error If an array of numbers is passed as the argument, then the returned result will also be an array with the same dimensions

The documentation for this class was generated from the following file: