2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-02 11:40:58 +00:00

Decimal rendering - support "minimum places" setting (#4527)

* Add configurable setting for "minimum" decimal places

* Specify minimum decimal places to 'render_currency'

* Fix for rendering currency in tables
This commit is contained in:
Oliver
2023-03-24 23:46:29 +11:00
committed by GitHub
parent 4006ccfa0d
commit be92a4345c
4 changed files with 28 additions and 14 deletions

View File

@ -1216,9 +1216,20 @@ class InvenTreeSetting(BaseInvenTreeSetting):
'default': '',
},
'PRICING_DECIMAL_PLACES_MIN': {
'name': _('Minimum Pricing Decimal Places'),
'description': _('Minimum number of decimal places to display when rendering pricing data'),
'default': 0,
'validator': [
int,
MinValueValidator(0),
MaxValueValidator(4),
]
},
'PRICING_DECIMAL_PLACES': {
'name': _('Pricing Decimal Places'),
'description': _('Number of decimal places to display when rendering pricing data'),
'name': _('Maximum Pricing Decimal Places'),
'description': _('Maximum umber of decimal places to display when rendering pricing data'),
'default': 6,
'validator': [
int,