mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 09:39:57 +00:00
Make product amount picker locale independent (#876)
Since the value of $('#amount') will be written to the database it should not be locale dependent. This code also limits the result to a maximum of 4 digits but always uses a dot as decimal separator.
This commit is contained in:
parent
e4d0978f5d
commit
88949dc3e4
@ -83,7 +83,7 @@ $(".input-group-productamountpicker").on("change", function()
|
||||
$("#qu-conversion-info").text(__t("This equals %1$s %2$s in stock", destinationAmount.toLocaleString(), destinationQuName));
|
||||
}
|
||||
|
||||
$("#amount").val(destinationAmount.toLocaleString({ minimumFractionDigits: 0, maximumFractionDigits: 4 }));
|
||||
$("#amount").val(destinationAmount.toFixed(4).replace(/0*$/g,''));
|
||||
});
|
||||
|
||||
$("#display_amount").on("keyup", function()
|
||||
|
Loading…
x
Reference in New Issue
Block a user