Print format in Alert templates

Hi,

is there a way to format precision in alert templates?

Example:
{{ $value[‘some_column’]}} /1024 will return 1.23134

but i’d like to have a precision with 2 digits, so it returns 1.23

is there a way for it?

Haven’t tested but perhaps something along these lines

{{ number_format($value['some_column']/1024, 2) }}

or

@php echo (number_format($value['some_column']/1024, 2, '.', ',')); @endphp

{{ number_format($value['some_column']/1024, 2) }}

works like a charm!

btw. which template language is used for Alert Templates?
So i can take a look for more Features of it to use

1 Like

its a php function https://www.php.net/manual/en/function.number-format.php