prepare release 1.15 (#2707)
* bump version * fix invisible class on labels * fail safe removal of foreign key * check if optional form field exists before accessing it * silently ignore stopped timesheets * prevent colliding parameter names * make sure decimal duration is always rendered with two decimals * simplify translation * fix #2751 ANSI_QUOTES * rename composer task * fix billable statistic rates * added missing translation for export
This commit is contained in:
@@ -24,6 +24,10 @@ final class LocaleHelper
|
||||
* @var NumberFormatter
|
||||
*/
|
||||
private $numberFormatter;
|
||||
/**
|
||||
* @var NumberFormatter
|
||||
*/
|
||||
private $durationFormatter;
|
||||
/**
|
||||
* @var NumberFormatter
|
||||
*/
|
||||
@@ -51,10 +55,12 @@ final class LocaleHelper
|
||||
$value = 0;
|
||||
}
|
||||
|
||||
return $this->getNumberFormatter()->format((float) $value);
|
||||
return $this->getDurationFormatter()->format((float) $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Only used in twig filter |amount and invoice templates
|
||||
*
|
||||
* @param string|float $amount
|
||||
* @return bool|false|string
|
||||
*/
|
||||
@@ -133,6 +139,16 @@ final class LocaleHelper
|
||||
return $this->numberFormatter;
|
||||
}
|
||||
|
||||
private function getDurationFormatter(): NumberFormatter
|
||||
{
|
||||
if (null === $this->numberFormatter) {
|
||||
$this->durationFormatter = new NumberFormatter($this->locale, NumberFormatter::DECIMAL);
|
||||
$this->durationFormatter->setAttribute(NumberFormatter::FRACTION_DIGITS, 2);
|
||||
}
|
||||
|
||||
return $this->durationFormatter;
|
||||
}
|
||||
|
||||
private function getMoneyFormatter(bool $withCurrency = true): NumberFormatter
|
||||
{
|
||||
if ($withCurrency) {
|
||||
|
||||
Reference in New Issue
Block a user