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:
Matthias B 2020-08-18 19:43:50 +02:00 committed by GitHub
parent e4d0978f5d
commit 88949dc3e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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()