diff --git a/backend/app/assets/javascripts/spree/backend/format_money.js b/backend/app/assets/javascripts/spree/backend/format_money.js index 6f327937053..535693cbd9a 100644 --- a/backend/app/assets/javascripts/spree/backend/format_money.js +++ b/backend/app/assets/javascripts/spree/backend/format_money.js @@ -7,5 +7,5 @@ Spree.formatMoney = function(amount, currency) { var thousand = Spree.t('currency_delimiter'); var decimal = Spree.t('currency_separator'); - return accounting.formatMoney(amount, currencyInfo[0], currencyInfo[1], thousand, decimal, currencyInfo[2]); + return accounting.formatMoney(amount, currencyInfo[0], currencyInfo[1], thousand, decimal, currencyInfo[2]).trim(); } diff --git a/backend/app/views/spree/admin/shared/_js_locale_data.html.erb b/backend/app/views/spree/admin/shared/_js_locale_data.html.erb index b92b6ca38c2..47c0d3381c0 100644 --- a/backend/app/views/spree/admin/shared/_js_locale_data.html.erb +++ b/backend/app/views/spree/admin/shared/_js_locale_data.html.erb @@ -17,11 +17,14 @@ JSON.dump( Spree::Config.available_currencies.map { |c| format = - if c.symbol == "" || c.symbol_first + if c.format.present? + c.format.gsub("%u", "%s").gsub("%n", "%v") + elsif c.symbol == "" || c.symbol_first "%s%v" else "%v %s" end + [c.id.to_s.upcase, [ c.symbol || "ยค", c.exponent,