@@ -2,6 +2,7 @@ var __ = require('underscore'),
22 Backbone = require ( 'backbone' ) ,
33 $ = require ( 'jquery' ) ,
44 numberSpinners = require ( '../utils/numberSpinners' ) ,
5+ app = require ( '../App' ) . getApp ( ) ,
56 loadTemplate = require ( '../utils/loadTemplate' ) ;
67Backbone . $ = $ ;
78
@@ -72,21 +73,21 @@ module.exports = Backbone.View.extend({
7273 moderatorPrice = moderatorPercentage ? totalItemPrice * moderatorPercentage : 0 ,
7374 moderatorTotal = moderatorPrice * quantity ,
7475 totalPrice = totalItemPrice + totalShipping ,
75- newBTCDisplayPrice = Number ( ( this . model . get ( 'vendorBTCPrice' ) * quantity ) . toFixed ( 8 ) ) ,
76- newBTCShippingDisplayPrice = Number ( ( this . model . get ( 'currentShippingBTCPrice' ) * quantity ) . toFixed ( 8 ) ) ,
77- newDisplayPrice = ( userCurrency == "BTC" ) ? Number ( totalItemPrice . toFixed ( 8 ) ) + " BTC" : new Intl . NumberFormat ( window . lang , {
76+ newBTCDisplayPrice = app . intlNumFormat ( ( this . model . get ( 'vendorBTCPrice' ) * quantity ) , 8 ) ,
77+ newBTCShippingDisplayPrice = app . intlNumFormat ( ( this . model . get ( 'currentShippingBTCPrice' ) * quantity ) , 8 ) ,
78+ newDisplayPrice = ( userCurrency == "BTC" ) ? app . intlNumFormat ( totalItemPrice , 8 ) + " BTC" : new Intl . NumberFormat ( window . lang , {
7879 style : 'currency' ,
7980 minimumFractionDigits : 2 ,
8081 maximumFractionDigits : 2 ,
8182 currency : userCurrency
8283 } ) . format ( totalItemPrice ) ,
83- newDisplayShippingPrice = ( userCurrency == "BTC" ) ? Number ( totalShipping . toFixed ( 8 ) ) + " BTC" : new Intl . NumberFormat ( window . lang , {
84+ newDisplayShippingPrice = ( userCurrency == "BTC" ) ? app . intlNumFormat ( totalShipping , 8 ) + " BTC" : new Intl . NumberFormat ( window . lang , {
8485 style : 'currency' ,
8586 minimumFractionDigits : 2 ,
8687 maximumFractionDigits : 2 ,
8788 currency : userCurrency
8889 } ) . format ( totalShipping ) ,
89- newDisplayModeratorPrice = ( userCurrency == "BTC" ) ? Number ( moderatorTotal . toFixed ( 8 ) ) + " BTC" : new Intl . NumberFormat ( window . lang , {
90+ newDisplayModeratorPrice = ( userCurrency == "BTC" ) ? app . intlNumFormat ( moderatorTotal , 8 ) + " BTC" : new Intl . NumberFormat ( window . lang , {
9091 style : 'currency' ,
9192 minimumFractionDigits : 2 ,
9293 maximumFractionDigits : 2 ,
@@ -95,7 +96,7 @@ module.exports = Backbone.View.extend({
9596 totalBTCDisplayPrice = ( this . model . get ( 'vendorBTCPrice' ) + this . model . get ( 'currentShippingBTCPrice' ) ) * quantity ,
9697 moderatorPriceBTC = moderatorPercentage ? totalBTCDisplayPrice * moderatorPercentage : 0 ,
9798 moderatorPriceString = this . model . get ( 'userCurrencyCode' ) == 'BTC' ?
98- moderatorPriceBTC . toFixed ( 8 ) + " BTC" : moderatorPriceBTC . toFixed ( 8 ) + " BTC (" + newDisplayModeratorPrice + ")" ;
99+ app . intlNumFormat ( moderatorPriceBTC , 8 ) + " BTC" : app . intlNumFormat ( moderatorPriceBTC , 8 ) + " BTC (" + newDisplayModeratorPrice + ")" ;
99100
100101 this . $ ( '.js-buyWizardBTCPrice' ) . html ( newBTCDisplayPrice + "BTC" ) ;
101102 this . $ ( '.js-buyWizardBTCShippingPrice' ) . html ( newBTCShippingDisplayPrice + "BTC" ) ;
0 commit comments