tera icon indicating copy to clipboard operation
tera copied to clipboard

Support for formatting

Open MichaelSasser opened this issue 5 years ago • 2 comments

Hi,

Jinja has this nice support for formatting like:

{{ '0x%0X' % payload.id }}

It would be nice to have something like this in tera, specially for integers file types. Maybe something more rust like:

0x{{ payload.id | format(":X") }}
or 
0x{{ payload.id | format=":X" }}

MichaelSasser avatar Dec 13 '19 17:12 MichaelSasser

I would take a PR for that if it doesn't bring some big dependencies.

Keats avatar May 16 '20 08:05 Keats

I need to add decimal separators to numbers, e.g. 1000 -> 1,000 or 123456 -> 123,456, which may be 123.456 in some locales. @Kixiron , would I be able to do that with PR #517?

rimutaka avatar Mar 12 '21 01:03 rimutaka