use floor() instead of round() to convert msat to sat in frontend (#2070)

* use floor() instead of round() to convert msat to sat in frontend
This commit is contained in:
Pavol Rusnak 2023-11-06 07:49:47 +01:00 committed by GitHub
parent 3e142fab0f
commit 1ab68e80b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 4 deletions

File diff suppressed because one or more lines are too long

View File

@ -196,7 +196,7 @@ window.LNbits = {
currency: data.currency
}
newWallet.msat = data.balance_msat
newWallet.sat = Math.round(data.balance_msat / 1000)
newWallet.sat = Math.floor(data.balance_msat / 1000)
newWallet.fsat = new Intl.NumberFormat(window.LOCALE).format(
newWallet.sat
)

View File

@ -1,6 +1,6 @@
// update cache version every time there is a new deployment
// so the service worker reinitializes the cache
const CACHE_VERSION = 67
const CACHE_VERSION = 68
const CURRENT_CACHE = `lnbits-${CACHE_VERSION}-`
const getApiKey = request => {

View File

@ -791,7 +791,7 @@ new Vue({
},
fetchBalance: function () {
LNbits.api.getWallet(this.g.wallet).then(response => {
this.balance = Math.round(response.data.balance / 1000)
this.balance = Math.floor(response.data.balance / 1000)
EventHub.$emit('update-wallet-balance', [
this.g.wallet.id,
this.balance