Merge pull request #16007 from edx/aj/LEARNER-2291

Set formatting to show 2 decimal places on Program Purchase button
This commit is contained in:
Albert (AJ) St. Aubin
2017-09-13 10:34:24 -04:00
committed by GitHub
2 changed files with 5 additions and 4 deletions

View File

@@ -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 )'
);
});

View File

@@ -26,13 +26,14 @@
<% if (discount_data.is_discounted) { %>
<span class='list-price'>
<%- StringUtils.interpolate(
gettext('${listPrice}'), {listPrice: discount_data.total_incl_tax_excl_discounts}
gettext('${listPrice}'), {listPrice: discount_data.total_incl_tax_excl_discounts.toFixed(2)}
)
%>
</span>
<% } %>
<%- 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}
)
%>
</a>