From 9d0a1e80c700e71d1f73071b359e6dd0dcf28fdf Mon Sep 17 00:00:00 2001 From: "Albert St. Aubin" Date: Tue, 12 Sep 2017 14:08:27 -0400 Subject: [PATCH] Set formatting to show 2 decimal places on Program Purchase button [LEARNER-2291] --- .../js/spec/learner_dashboard/program_details_view_spec.js | 4 ++-- .../learner_dashboard/program_details_view.underscore | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lms/static/js/spec/learner_dashboard/program_details_view_spec.js b/lms/static/js/spec/learner_dashboard/program_details_view_spec.js index b7f07b5e6c..57f0670504 100644 --- a/lms/static/js/spec/learner_dashboard/program_details_view_spec.js +++ b/lms/static/js/spec/learner_dashboard/program_details_view_spec.js @@ -571,7 +571,7 @@ define([ expect($(view.$('.upgrade-button.complete-program')).text().trim(). replace(/\s+/g, ' ')). toEqual( - 'Upgrade All Remaining Courses ( $300 USD )' + 'Upgrade All Remaining Courses ( $300.00 USD )' ); }); @@ -592,7 +592,7 @@ define([ expect($(view.$('.upgrade-button.complete-program')).text().trim(). replace(/\s+/g, ' ')). toEqual( - 'Upgrade All Remaining Courses ( $270 $300 USD )' + 'Upgrade All Remaining Courses ( $270.00 $300.00 USD )' ); }); diff --git a/lms/templates/learner_dashboard/program_details_view.underscore b/lms/templates/learner_dashboard/program_details_view.underscore index a6c4f69eb1..48e2d5e717 100644 --- a/lms/templates/learner_dashboard/program_details_view.underscore +++ b/lms/templates/learner_dashboard/program_details_view.underscore @@ -26,13 +26,14 @@ <% if (discount_data.is_discounted) { %> <%- StringUtils.interpolate( - gettext('${listPrice}'), {listPrice: discount_data.total_incl_tax_excl_discounts} + gettext('${listPrice}'), {listPrice: discount_data.total_incl_tax_excl_discounts.toFixed(2)} ) %> <% } %> <%- StringUtils.interpolate( - gettext(' ${price} {currency} )'), {price: full_program_price, currency: discount_data.currency} + gettext(' ${price} {currency} )'), + {price: full_program_price.toFixed(2), currency: discount_data.currency} ) %>