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 "toFixed" #15

Open
danielvillalbamota opened this issue May 14, 2024 · 1 comment
Open

Support "toFixed" #15

danielvillalbamota opened this issue May 14, 2024 · 1 comment

Comments

@danielvillalbamota
Copy link

Currently expression round works rounding to integer and decimal.

According to other usages of jexl (javascript) we have toFixed to round decimals, so we could also implement toFixed as

super().add_transform("toFixed", lambda x, decimals: round(x, decimals)).

Moreover, should we limit the usage of round expression to round integer? This would be using the python function "round" without using the second parameter (ndigits) https://docs.python.org/3/library/functions.html#round

@fgalan
Copy link
Contributor

fgalan commented May 14, 2024

If we change existing transformation we have to analyse first its current usage, to detect potential backward compatibility problems.

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

No branches or pull requests

2 participants