/** * Format the given value depending on the currently used unit */ protected function format($value) { if ($this->isPercentage()) { return (string) $value . '%'; } if ($this->isBytes()) { return Format::bytes($value); } if ($this->isSeconds()) { return Format::seconds($value); } return number_format($value, 2); }