Open danielvillalbamota opened 4 months ago
Currently expression round works rounding to integer and decimal.
round
According to other usages of jexl (javascript) we have toFixed to round decimals, so we could also implement toFixed as
toFixed
super().add_transform("toFixed", lambda x, decimals: round(x, decimals)).
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
If we change existing transformation we have to analyse first its current usage, to detect potential backward compatibility problems.
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 implementtoFixed
assuper().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