Add integer when rendering price

This commit is contained in:
philipp lang 2024-02-23 16:33:29 +01:00
parent b4dbd7d312
commit 74800de149
1 changed files with 4 additions and 4 deletions

View File

@ -15,8 +15,8 @@ class BladeCompiler extends BaseBladeCompiler
public function registerEscapeDirective(): void
{
$this->directive('escape', fn ($expression) => implode('', [
'<?php echo str('.$expression.')',
'->replace("\\\", "'.$this->slashReplace.'")',
'<?php echo str(' . $expression . ')',
'->replace("\\\", "' . $this->slashReplace . '")',
'->replace("$", "\\\\$")',
'->replace("#", "\\\\#")',
'->replace("%", "\\\\%")',
@ -26,10 +26,10 @@ class BladeCompiler extends BaseBladeCompiler
'->replace("}", "\\\\}")',
'->replace("~", "$\\\textasciitilde$")',
'->replace("^", "$\\\textasciicircum$")',
'->replace("'.$this->slashReplace.'", "$\\\textbackslash$")',
'->replace("' . $this->slashReplace . '", "$\\\textbackslash$")',
'; ?>',
]));
$this->directive('price', fn ($expression) => '<?php echo number_format('.$expression.', 2, ",", "."); ?>');
$this->directive('price', fn ($expression) => '<?php echo number_format(' . $expression . ' / 100, 2, ",", "."); ?>');
}
}