mirror of
https://github.com/grocy/grocy.git
synced 2025-08-17 19:16:37 +00:00
Optimized "auto decimal separator for price inputs" (references #1345)
This commit is contained in:
@@ -102,7 +102,7 @@ $(".numberpicker.locale-number-input.locale-number-currency").on("blur", functio
|
|||||||
|
|
||||||
if (value.length <= decimalPlaces)
|
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 });
|
var valueNew = parseFloat(value.substring(0, value.length - decimalPlaces) + '.' + value.slice(decimalPlaces * -1)).toLocaleString(undefined, { minimumFractionDigits: decimalPlaces, maximumFractionDigits: decimalPlaces });
|
||||||
|
Reference in New Issue
Block a user