Skip to content
This repository was archived by the owner on May 16, 2019. It is now read-only.

Commit aacd6ab

Browse files
committed
add international number formatting to order short
1 parent f3243fa commit aacd6ab

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

js/templates/orderShort.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<tr>
2727
<td class="textOpacity50 padding2"><%= polyglot.t('transactions.OrderTotal') %> </td>
2828
<td class="padding2 textOpacity75">
29-
<%= ob.btc_total.toFixed(4) %> BTC
29+
<%= ob.intlNumFormat(ob.btc_total, 8) %> BTC
3030
<% if(ob.cCode != "BTC"){ %>
3131
(<%= ob.displayPrice %><!-- Would like to get this working at some point <span class="tooltip ion-information-circled fontSize12" data-tooltip="You received *VAL* in Bitcoin at the time of the sale."></span> -->)
3232
<% } %>

js/utils/templateHelpers.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,12 @@ function cssImageUrl(hash, guid, fallback) {
2424
return url;
2525
}
2626

27+
function intlNumFormat(numberToFormat, maxDigits){
28+
return new Intl.NumberFormat(window.lang, {maximumFractionDigits: maxDigits}).format(numberToFormat);
29+
}
30+
2731
module.exports = {
2832
cssImageUrl: cssImageUrl,
33+
intlNumFormat: intlNumFormat,
2934
moment: moment
3035
};

0 commit comments

Comments
 (0)