Setting Decimal Pla...
 
Notifications

Setting Decimal Places  

   RSS

0

How do you set the number of decimals places on an amount field?

Topic Tags
1 Answer
1

You can use the floatformat Django function. Here is an example where the value is set to six decimal places:

{% dictionary_add_key_value list_price "KBETR" list_price.KBETR|floatformat:-6 %}

More documentation on this function can be found here:

https://docs.djangoproject.com/en/2.2/ref/templates/builtins/#floatformat

Share: