trait Rounding
Trait Rounding.
Round, ceil, floor units.
Depends on the following methods:
Traits
Methods
Round the current instance at the given unit with given precision if specified and the given function.
Truncate the current instance at the given unit with given precision if specified.
Ceil the current instance at the given unit with given precision if specified.
Round the current instance second with given precision if specified.
Round the current instance second with given precision if specified.
Ceil the current instance second with given precision if specified.
Round the current instance week.
Truncate the current instance week.
Ceil the current instance week.
No description
No description
Details
inIntervalRoundingat line23
protected
callRoundMethod(string$method,array$parameters)
inIntervalRoundingat line38
protected
roundWith($precision,$function)
at line40
CarbonInterface
roundUnit(string$unit,float|int$precision =1,string$function ='round')
Round the current instance at the given unit with given precision if specified and the given function.
at line134
CarbonInterface
floorUnit(string$unit,float|int$precision =1)
Truncate the current instance at the given unit with given precision if specified.
at line147
CarbonInterface
ceilUnit(string$unit,float|int$precision =1)
Ceil the current instance at the given unit with given precision if specified.
at line160
CarbonInterface
round(float|int|string|DateInterval|null$precision =1,string$function ='round')
Round the current instance second with given precision if specified.
at line172
CarbonInterface
floor(float|int|string|DateInterval|null$precision =1)
Round the current instance second with given precision if specified.
at line184
CarbonInterface
ceil(float|int|string|DateInterval|null$precision =1)
Ceil the current instance second with given precision if specified.
at line196
CarbonInterface
roundWeek(int$weekStartsAt =null)
Round the current instance week.
at line211
CarbonInterface
floorWeek(int$weekStartsAt =null)
Truncate the current instance week.
at line223
CarbonInterface
ceilWeek(int$weekStartsAt =null)
Ceil the current instance week.