Is there a way to remove trailing zeros from a Decimal
field in a django template?
This is what I have: 0.0002559000
and this is what I need: 0.0002559
.
There are answers suggesting to do this using the floatformat
filter:
{{ balance.bitcoins|floatformat:3 }}
However, floatformat
performs rounding (either down or up), which is unwanted in my case, as I only need to remove trailing zeros without any rounding at all.