FileAccess Orion

Rounding

Trait Rounding.

Round, ceil, floor units.

Depends on the following methods:

Table of Contents

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

Methods

ceil()

Ceil the current instance second with given precision if specified.

public ceil([float|int|string|DateInterval|null $precision = 1 ]) : CarbonInterface
Parameters
$precision : float|int|string|DateInterval|null = 1
Return values
CarbonInterface

ceilUnit()

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

public ceilUnit(string $unit[, float|int $precision = 1 ]) : CarbonInterface
Parameters
$unit : string
$precision : float|int = 1
Return values
CarbonInterface

ceilWeek()

Ceil the current instance week.

public ceilWeek([int $weekStartsAt = null ]) : CarbonInterface
Parameters
$weekStartsAt : int = null

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

Return values
CarbonInterface

floor()

Round the current instance second with given precision if specified.

public floor([float|int|string|DateInterval|null $precision = 1 ]) : CarbonInterface
Parameters
$precision : float|int|string|DateInterval|null = 1
Return values
CarbonInterface

floorUnit()

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

public floorUnit(string $unit[, float|int $precision = 1 ]) : CarbonInterface
Parameters
$unit : string
$precision : float|int = 1
Return values
CarbonInterface

floorWeek()

Truncate the current instance week.

public floorWeek([int $weekStartsAt = null ]) : CarbonInterface
Parameters
$weekStartsAt : int = null

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

Return values
CarbonInterface

round()

Round the current instance second with given precision if specified.

public round([float|int|string|DateInterval|null $precision = 1 ][, string $function = 'round' ]) : CarbonInterface
Parameters
$precision : float|int|string|DateInterval|null = 1
$function : string = 'round'
Return values
CarbonInterface

roundUnit()

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

public roundUnit(string $unit[, float|int $precision = 1 ][, string $function = 'round' ]) : CarbonInterface
Parameters
$unit : string
$precision : float|int = 1
$function : string = 'round'
Return values
CarbonInterface

roundWeek()

Round the current instance week.

public roundWeek([int $weekStartsAt = null ]) : CarbonInterface
Parameters
$weekStartsAt : int = null

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

Return values
CarbonInterface

Search results