I'm trying to convert, eg:
0.00282357936911 to 2.82e-03 and 0.000130076846614 to 1.30e-04
However, when I use the filter {{ data|stringformat:"e" }}, I get
2.823579e-03 and 1.300768e-04
Is there are way to roundup to 2 decimal points?
Many thanks in advance.
You can use:
{{ data|stringformat:".2e" }}
The.<number> syntax specifies number of decimal points. See reference for more info.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With