Menu

## Rounding

Rounding.php : 31

Trait Rounding.

Round, ceil, floor units.

Depends on the following methods:

### Table of Contents

#### Methods

ceil() : static
  Ceil the current instance second with given precision if specified.
ceilUnit() : static
  Ceil the current instance at the given unit with given precision if specified.
ceilWeek() : static
  Ceil the current instance week.
copy() : void
floor() : static
  Round the current instance second with given precision if specified.
floorUnit() : static
  Truncate the current instance at the given unit with given precision if specified.
floorWeek() : static
  Truncate the current instance week.
round() : static
  Round the current instance second with given precision if specified.
roundUnit() : static
  Round the current instance at the given unit with given precision if specified and the given function.
roundWeek() : static
  Round the current instance week.
startOfWeek() : void

### Methods

#### ceil()

Rounding.php : 177

Ceil the current instance second with given precision if specified.

`public ceil([DateInterval|string|float|int $precision = 1 ]) : static`

##### Parameters

$precision : DateInterval|string|float|int = 1

##### Return values

static

#### ceilUnit()

Rounding.php : 153

Ceil the current instance at the given unit with given precision if specified.

`public ceilUnit(string $unit[, DateInterval|string|float|int $precision = 1 ]) : static`

##### Parameters

$unit : string
$precision : DateInterval|string|float|int = 1

##### Return values

static

#### ceilWeek()

Rounding.php : 210

Ceil the current instance week.

`public ceilWeek([WeekDay|int|null $weekStartsAt = null ]) : static`

##### Parameters

$weekStartsAt : WeekDay|int|null = null

  optional start allow you to specify the day of week to use to start the week

##### Return values

static

#### copy()

Rounding.php : 0
`public static copy() : void`

#### floor()

Rounding.php : 169

Round the current instance second with given precision if specified.

`public floor([DateInterval|string|float|int $precision = 1 ]) : static`

##### Parameters

$precision : DateInterval|string|float|int = 1

##### Return values

static

#### floorUnit()

Rounding.php : 145

Truncate the current instance at the given unit with given precision if specified.

`public floorUnit(string $unit[, DateInterval|string|float|int $precision = 1 ]) : static`

##### Parameters

$unit : string
$precision : DateInterval|string|float|int = 1

##### Return values

static

#### floorWeek()

Rounding.php : 200

Truncate the current instance week.

`public floorWeek([WeekDay|int|null $weekStartsAt = null ]) : static`

##### Parameters

$weekStartsAt : WeekDay|int|null = null

  optional start allow you to specify the day of week to use to start the week

##### Return values

static

#### round()

Rounding.php : 161

Round the current instance second with given precision if specified.

`public round([DateInterval|string|float|int $precision = 1 ][, callable|string $function = 'round' ]) : static`

##### Parameters

$precision : DateInterval|string|float|int = 1
$function : callable|string = 'round'

##### Return values

static

#### roundUnit()

Rounding.php : 38

Round the current instance at the given unit with given precision if specified and the given function.

`public roundUnit(string $unit[, DateInterval|string|float|int $precision = 1 ][, callable|string $function = 'round' ]) : static`

##### Parameters

$unit : string
$precision : DateInterval|string|float|int = 1
$function : callable|string = 'round'

##### Return values

static

#### roundWeek()

Rounding.php : 187

Round the current instance week.

`public roundWeek([WeekDay|int|null $weekStartsAt = null ]) : static`

##### Parameters

$weekStartsAt : WeekDay|int|null = null

  optional start allow you to specify the day of week to use to start the week

##### Return values

static

#### startOfWeek()

Rounding.php : 0
`public static startOfWeek(int $weekStartsAt = null) : void`

##### Parameters

$weekStartsAt = null : int

## Search results