public format ( $time, $unit = null, $mode = null, $precision = null, $suffix = true ) |
public function format($time, $unit = null, $mode = null, $precision = null, $suffix = true)
{
$value = number_format($this->toDestUnit($time, $unit, $mode), $precision !== null ? $precision : $this->precision);
if (false === $suffix) {
return $value;
}
$suffix = $this->getDestSuffix($unit, $mode);
return $value . $suffix;
}
/** * {@inheritdoc} */ public function format($subject, array $options) { return $this->timeUnit->format($subject, in_array('unit', $options['resolve']) ? $this->timeUnit->resolveDestUnit($options['unit']) : $options['unit'], in_array('mode', $options['resolve']) ? $this->timeUnit->resolveMode($options['mode']) : $options['mode'], $this->timeUnit->resolvePrecision($options['precision'])); }