Allow price up to 4 decimals instead of 2 (#1077)

* Allow price to be 4 decimals

* remove logging

* Finalize custom decimal places by user setting

* Typo

Co-authored-by: Bernd Bestel <bernd@berrnd.de>
This commit is contained in:
kriddles
2020-10-20 13:08:54 -05:00
committed by GitHub
parent 9e982979c3
commit 46e8123477
31 changed files with 147 additions and 128 deletions

View File

@@ -553,7 +553,7 @@ function RefreshLocaleNumberDisplay(rootSelector = "#page-content")
return;
}
$(this).text(parseFloat($(this).text()).toLocaleString(undefined, { style: "currency", currency: Grocy.Currency }));
$(this).text(parseFloat($(this).text()).toLocaleString(undefined, { style: "currency", currency: Grocy.Currency, minimumFractionDigits: 2, maximumFractionDigits: Grocy.UserSettings.stock_decimal_places_prices }));
});
$(rootSelector + " .locale-number.locale-number-quantity-amount").each(function()
@@ -563,7 +563,7 @@ function RefreshLocaleNumberDisplay(rootSelector = "#page-content")
return;
}
$(this).text(parseFloat($(this).text()).toLocaleString(undefined, { minimumFractionDigits: 0, maximumFractionDigits: 3 }));
$(this).text(parseFloat($(this).text()).toLocaleString(undefined, { minimumFractionDigits: 0, maximumFractionDigits: Grocy.UserSettings.stock_decimal_places_amounts }));
});
$(rootSelector + " .locale-number.locale-number-generic").each(function()