mirror of
https://github.com/grocy/grocy.git
synced 2025-04-28 17:23:56 +00:00
Optimized dynamic leading zeros rounding in productamountpicker (fixes #1943)
This commit is contained in:
parent
8cb9157c73
commit
e64df711e2
@ -9,6 +9,7 @@
|
||||
### Stock
|
||||
|
||||
- Fixed that the average shelf life of a product (on the productcard) was wrong when the corresponding stock entry was edited
|
||||
- Fixed that when the stock setting "Decimal places allowed for amounts" was set to `0`, unit conversion (if any) failed when adding the corresponding product to stock
|
||||
|
||||
### Shopping list
|
||||
|
||||
|
@ -106,7 +106,13 @@ $(".input-group-productamountpicker").on("change", function()
|
||||
$("#qu-conversion-info").text(__t("This equals %1$s %2$s", destinationAmount.toLocaleString({ minimumFractionDigits: 0, maximumFractionDigits: Grocy.UserSettings.stock_decimal_places_amounts }), destinationQuName));
|
||||
}
|
||||
|
||||
$("#amount").val(destinationAmount.toFixed(Grocy.UserSettings.stock_decimal_places_amounts).replace(/0*$/g, ''));
|
||||
var n = Number.parseInt(Grocy.UserSettings.stock_decimal_places_amounts);
|
||||
if (n <= 0)
|
||||
{
|
||||
n = 1;
|
||||
}
|
||||
|
||||
$("#amount").val(destinationAmount.toFixed(n).replace(/0*$/g, ''));
|
||||
});
|
||||
|
||||
$("#display_amount").on("keyup", function()
|
||||
|
Loading…
x
Reference in New Issue
Block a user