mirror of
https://github.com/grocy/grocy.git
synced 2025-10-12 08:34:48 +00:00
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:
@@ -324,11 +324,11 @@ $("#allow_partial_units_in_stock").on("click", function()
|
||||
{
|
||||
if (this.checked)
|
||||
{
|
||||
$("#min_stock_amount").attr("min", "0.0000");
|
||||
$("#min_stock_amount").attr("step", ".0001");
|
||||
$("#qu_factor_purchase_to_stock").attr("min", "0.0001");
|
||||
$("#qu_factor_purchase_to_stock").attr("step", ".0001");
|
||||
$("#qu_factor_purchase_to_stock").parent().find(".invalid-feedback").text(__t('This cannot be lower than %1$s and must be a valid number with max. %2$s decimal places', 0.0001.toLocaleString(undefined, { minimumFractionDigits: 0, maximumFractionDigits: 4 }), '4'));
|
||||
$("#min_stock_amount").attr("min", "0." + "0".repeat(parseInt(Grocy.UserSettings.stock_decimal_places_amounts)));
|
||||
$("#min_stock_amount").attr("step", "." + "0".repeat(parseInt(Grocy.UserSettings.stock_decimal_places_amounts) - 1) + "1");
|
||||
$("#qu_factor_purchase_to_stock").attr("min", "0." + "0".repeat(parseInt(Grocy.UserSettings.stock_decimal_places_amounts) - 1) + "1");
|
||||
$("#qu_factor_purchase_to_stock").attr("step", "." + "0".repeat(parseInt(Grocy.UserSettings.stock_decimal_places_amounts) - 1) + "1");
|
||||
$("#qu_factor_purchase_to_stock").parent().find(".invalid-feedback").text(__t('This cannot be lower than %1$s and must be a valid number with max. %2$s decimal places', "0." + "0".repeat(parseInt(Grocy.UserSettings.stock_decimal_places_amounts) - 1) + "1", Grocy.UserSettings.stock_decimal_places_amounts));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Reference in New Issue
Block a user