mirror of
https://github.com/lnbits/lnbits.git
synced 2025-09-28 21:02:31 +02:00
format
This commit is contained in:
committed by
Vlad Stan
parent
b0b1446483
commit
476f915fd2
@@ -363,13 +363,14 @@
|
|||||||
return Number(this.stack.join('') / 100)
|
return Number(this.stack.join('') / 100)
|
||||||
},
|
},
|
||||||
famount: function () {
|
famount: function () {
|
||||||
return LNbits.utils.formatCurrency(this.amount.toFixed(2), this.currency)
|
return LNbits.utils.formatCurrency(
|
||||||
|
this.amount.toFixed(2),
|
||||||
|
this.currency
|
||||||
|
)
|
||||||
},
|
},
|
||||||
sat: function () {
|
sat: function () {
|
||||||
if (!this.exchangeRate) return 0
|
if (!this.exchangeRate) return 0
|
||||||
return Math.ceil(
|
return Math.ceil((this.amount / this.exchangeRate) * 100000000)
|
||||||
(this.amount / this.exchangeRate) * 100000000
|
|
||||||
)
|
|
||||||
},
|
},
|
||||||
tipAmountSat: function () {
|
tipAmountSat: function () {
|
||||||
if (!this.exchangeRate) return 0
|
if (!this.exchangeRate) return 0
|
||||||
@@ -392,11 +393,11 @@
|
|||||||
processTipSelection: function (selectedTipOption) {
|
processTipSelection: function (selectedTipOption) {
|
||||||
this.tipDialog.show = false
|
this.tipDialog.show = false
|
||||||
|
|
||||||
if(!selectedTipOption) return this.showInvoice()
|
if (!selectedTipOption) return this.showInvoice()
|
||||||
|
|
||||||
const tipAmount = (selectedTipOption / 100) * this.amount
|
const tipAmount = (selectedTipOption / 100) * this.amount
|
||||||
const subtotal = this.amount
|
const subtotal = this.amount
|
||||||
const grandTotal = (tipAmount + subtotal)
|
const grandTotal = tipAmount + subtotal
|
||||||
const totalString = grandTotal.toFixed(2)
|
const totalString = grandTotal.toFixed(2)
|
||||||
|
|
||||||
this.stack = []
|
this.stack = []
|
||||||
@@ -408,7 +409,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
this.tipAmount = tipAmount
|
this.tipAmount = tipAmount
|
||||||
|
|
||||||
this.showInvoice()
|
this.showInvoice()
|
||||||
|
Reference in New Issue
Block a user