Optimized "auto decimal separator for price inputs" (references #1345)

This commit is contained in:
Bernd Bestel 2021-07-17 00:21:48 +02:00
parent edfa404ed6
commit 5478bec2c7
No known key found for this signature in database
GPG Key ID: 71BD34C0D4891300

View File

@ -102,7 +102,7 @@ $(".numberpicker.locale-number-input.locale-number-currency").on("blur", functio
if (value.length <= decimalPlaces)
{
return;
value = value.padStart(Grocy.UserSettings.stock_decimal_places_prices, "0");
}
var valueNew = parseFloat(value.substring(0, value.length - decimalPlaces) + '.' + value.slice(decimalPlaces * -1)).toLocaleString(undefined, { minimumFractionDigits: decimalPlaces, maximumFractionDigits: decimalPlaces });