feat: show total in fiat
This commit is contained in:
parent
5942d135b3
commit
39bcbfb035
4 changed files with 72 additions and 8 deletions
|
|
@ -48,6 +48,16 @@ function isJson(str) {
|
|||
}
|
||||
}
|
||||
|
||||
function satOrBtc(val, showUnit = true, showSats = false) {
|
||||
const value = showSats
|
||||
? LNbits.utils.formatSat(val)
|
||||
: val == 0
|
||||
? 0.0
|
||||
: (val / 100000000).toFixed(8)
|
||||
if (!showUnit) return value
|
||||
return showSats ? value + ' sat' : value + ' BTC'
|
||||
}
|
||||
|
||||
function timeFromNow(time) {
|
||||
// Get timestamps
|
||||
let unixTime = new Date(time).getTime()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue