Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert jQuery data attribute to number
JQuery numeric string data attributes are not casted to numbers consistently. There are instances when they are kept as string, this behavior seems to be related to the presence of insignificant zeros in the original string: $('<div data-price="12.00"></div>').data('price') > "12.00" $('<div data-price="12.10"></div>').data('price') > "12.10" but: $('<div data-price="12.1"></div>').data('price') > 12.1 So, we need to enforce the typecast to number when summing those attributes in the function `totalSelectedReturnItemAmount`. After the sum, the number needs to be converted to a properly localized amount. For this we leverage the existing function `formatNumber` from the library `accounting.js`, see https://github.com/solidusio/solidus/blob/master/backend/vendor/assets/javascripts/solidus_admin/accounting.js
- Loading branch information