format(); } /** * E.g. 6 quarters → "1,5". */ public static function hours(int $quarters): string { return rtrim(rtrim(number_format($quarters / 4, 2, ',', "\u{00A0}"), '0'), ','); } /** * Hours for a CSV cell: a decimal comma and no thousands separator. */ public static function csvHours(int $quarters): string { return rtrim(rtrim(number_format($quarters / 4, 2, ',', ''), '0'), ','); } /** * E.g. 0.256 → "25,6 %". */ public static function percent(float $ratio): string { return number_format($ratio * 100, 1, ',', "\u{00A0}")."\u{00A0}%"; } public static function date(string $day): string { return (new DateTimeImmutable($day))->format('j.n.Y'); } public static function period(ReportPeriod $period): string { return self::date($period->from).'–'.self::date($period->to); } }