Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for formatting #474

Open
MichaelSasser opened this issue Dec 13, 2019 · 2 comments · May be fixed by #517
Open

Support for formatting #474

MichaelSasser opened this issue Dec 13, 2019 · 2 comments · May be fixed by #517

Comments

@MichaelSasser
Copy link

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 MichaelSasser changed the title Support for formating Support for formatting Dec 17, 2019
@Keats
Copy link
Owner

Keats commented May 16, 2020

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

@Kixiron Kixiron linked a pull request May 29, 2020 that will close this issue
@rimutaka
Copy link
Contributor

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants