Forum Discussion
Assuming that [MyField] is a variable in your Jinja2 template that contains a numeric value, you can use the following expression to multiply it by 0.68:
{{ MyField * 0.68 }}
This expression multiplies the value of [MyField] by 0.68 and returns the result as a new value. The result will be a float value if [MyField] is a float, or an integer value if [MyField] is an integer.
------------------------------
Shane Miller
------------------------------
- MikeTamoush3 years agoQrew Elite
I mistyped in my post. I should have said I tried {{MyField * .68}} and it would not work.
However, {{MyField * 0.68}} DOES work! Thank you! Turns out that leading zero is important.
------------------------------
Mike Tamoush
------------------------------- MikeTamoush3 years agoQrew Elite
Any idea the syntax to round the number to 2 decimals?
I tried {{MyField * 0.68 | round(2) }} but this did not work.
------------------------------
Mike Tamoush
------------------------------- DougHenning13 years agoCommunity Manager
Round to 2 decimals:
{{ "%.02f" | format(MyField * 0.68) }}
------------------------------
Doug Henning
------------------------------