format('j.n.'); } public static function hours(float|string|null $hours): string { if ($hours === null || $hours === '') { return '0'; } $text = rtrim(rtrim(number_format((float) $hours, 2, '.', ''), '0'), '.'); return str_replace('.', ',', $text === '' ? '0' : $text); } /** * "1,5/4 h": recorded against estimated hours. */ public static function cardHours(BoardCard $card): string { return __('jobs.board.hours', [ 'logged' => self::hours($card->loggedHours()), 'estimated' => self::hours($card->estimatedHours), ]); } }