diff --git a/BTCPayServer/Views/UIInvoice/Checkout.cshtml b/BTCPayServer/Views/UIInvoice/Checkout.cshtml index 44ee74432..939734b04 100644 --- a/BTCPayServer/Views/UIInvoice/Checkout.cshtml +++ b/BTCPayServer/Views/UIInvoice/Checkout.cshtml @@ -59,7 +59,7 @@ } else { -

@Model.BtcDue @Model.CryptoCode

+

@Model.BtcDue @Model.CryptoCode

}
@@ -256,37 +256,37 @@
-
{{srvModel.orderAmount}} {{ srvModel.cryptoCode }}
+
{{srvModel.orderAmount}} {{ srvModel.cryptoCode }}
-
{{srvModel.orderAmountFiat}}
+
{{srvModel.orderAmountFiat}}
-
+
-
+
-
+
-
+
-
+
diff --git a/BTCPayServer/wwwroot/checkout/checkout.js b/BTCPayServer/wwwroot/checkout/checkout.js index 3c731cb51..1f13f6921 100644 --- a/BTCPayServer/wwwroot/checkout/checkout.js +++ b/BTCPayServer/wwwroot/checkout/checkout.js @@ -56,6 +56,10 @@ function updateLanguage(lang) { } } +function asNumber(val) { + return val && parseFloat(val.toString().replace(/\s/g, '')); // e.g. sats are formatted with spaces: 1 000 000 +} + Vue.use(VueI18next); const fallbackLanguage = 'en'; @@ -71,6 +75,9 @@ const PaymentDetails = { orderAmount: Number, btcPaid: Number, btcDue: Number + }, + methods: { + asNumber } } @@ -242,6 +249,7 @@ function initApp() { } }, methods: { + asNumber, changePaymentMethod (id) { // payment method or plugin id if (this.pmId !== id) { this.paymentMethodId = id; @@ -251,9 +259,6 @@ function initApp() { changeLanguage (e) { updateLanguage(e.target.value); }, - asNumber (val) { - return parseFloat(val.replace(/\s/g, '')); // e.g. sats are formatted with spaces: 1 000 000 - }, padTime (val) { return val.toString().padStart(2, '0'); },