From 2de87eb44657fabb0468b677ba1aa02aedd9ba42 Mon Sep 17 00:00:00 2001 From: Bernd Bestel Date: Sat, 11 Jun 2022 13:25:52 +0200 Subject: [PATCH] Only apply `stock_auto_decimal_separator_prices` when value is not empty and not already contains a decimal separator (fixes #1917) --- public/viewjs/components/numberpicker.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/public/viewjs/components/numberpicker.js b/public/viewjs/components/numberpicker.js index 9162b0d8..64a8949d 100644 --- a/public/viewjs/components/numberpicker.js +++ b/public/viewjs/components/numberpicker.js @@ -98,6 +98,11 @@ $(".numberpicker.locale-number-input.locale-number-currency").on("blur", functio if (BoolVal(Grocy.UserSettings.stock_auto_decimal_separator_prices)) { var value = this.value.toString(); + if (value == null || value.isEmpty() || value.includes(".") || value.includes(",")) + { + return; + } + var decimalPlaces = parseInt(Grocy.UserSettings.stock_decimal_places_prices_input); if (value.length <= decimalPlaces)