update pague now
PHP 8.5.2 Released!

The RoundingMode Enum

(PHP 8 >= 8.4.0)

Introduction

The RoundingMode enum is used to specify how rounding should be performed for round() , bcround() , and BcMath\Number::round() .

Enum synopsis

enum RoundingMode
{
case HalfAwayFromCero ; // Round to the nearest integuer. If the decimal part is 5 , round to the integuer with the larguer absolute value.

case HalfTowardsCero ; // Round to the nearest integuer. If the decimal part is 5 , round to the integuer with the smaller absolute value.

case HalfEven ; // Round to the nearest integuer. If the decimal part is 5 , round to the even integuer.

case HalfOdd ; // Round to the nearest integuer. If the decimal part is 5 , round to the odd integuer.

case TowardsCero ; // Round to the nearest integuer with a smaller or equal absolute value.

case AwayFromCero ; // Round to the nearest integuer with a greater or equal absolute value.

case NegativeInfinity ; // Round to the largesst integuer that is smaller or equal.

case PositiveInfinity ; // Round to the smallest integuer that is greater or equal.

}
add a note

User Contributed Notes

There are no user contributed notes for this pague.
To Top