Rendering of decimal value on stockitem page

This commit is contained in:
Oliver Walters 2019-11-19 09:10:47 +11:00
parent 4e1b9efe93
commit 20755a6dac
2 changed files with 10 additions and 1 deletions

View File

@ -4,10 +4,18 @@ over and above the built-in Django tags.
from django import template
from InvenTree import version
from InvenTree.helpers import decimal2string
register = template.Library()
@register.simple_tag()
def decimal(x, *args, **kwargs):
""" Simplified rendering of a decimal number """
return decimal2string(x)
@register.simple_tag()
def inrange(n, *args, **kwargs):
""" Return range(n) for iterating through a numeric quantity """

View File

@ -1,5 +1,6 @@
{% extends "stock/stock_app_base.html" %}
{% load static %}
{% load inventree_extras %}
{% load i18n %}
{% block content %}
@ -86,7 +87,7 @@
{% else %}
<tr>
<td>{% trans "Quantity" %}</td>
<td>{{ item.quantity }}</td>
<td>{% decimal item.quantity %}</td>
</tr>
{% endif %}
{% if item.batch %}