mirror of
https://github.com/grocy/grocy.git
synced 2026-04-07 21:26:16 +02:00
Make product amount picker locale independent
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
98f214e9f1
commit
02becabf07
|
|
@ -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));
|
$("#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()
|
$("#display_amount").on("keyup", function()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user