Skip to content

Commit

Permalink
fix decimals for sats
Browse files Browse the repository at this point in the history
  • Loading branch information
0xf0xx0 committed Oct 14, 2023
1 parent 65c71c0 commit 2411716
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/btcCoinConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const currencyUnits = [
active:true,
multiplier:100000000,
values:["sat", "satoshi"],
decimalPlaces:0
decimalPlaces:3
},
{
type:"native",
Expand Down
2 changes: 1 addition & 1 deletion app/currencies.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ global.currencyTypes = {
type: "native",
name: "sat",
multiplier: 100000000,
decimalPlaces: 0
decimalPlaces: 3
},
"msat": {
id: "msat",
Expand Down
1 change: 1 addition & 0 deletions public/scss/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ pre {
.chan-flags {
display: flex;
flex-direction: column;
gap: .1em;
}
// bad pills, no expanding!
.chan-flags > span {
Expand Down
3 changes: 2 additions & 1 deletion views/forwarding-history.pug
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ block content

tbody
each forwardingEvent, forwardingEventIndex in pagedFilteredEvents
// .fee is a int, use .fee_msat to get the decimal
- forwardingEvent.fee = forwardingEvent.fee_msat / 1000
tr
th.text-end.fw-light #{(forwardingEventIndex + offset + 1).toLocaleString()}

Expand Down Expand Up @@ -194,7 +196,6 @@ block content
td.text-end
.text-success
span +

+btcValue(forwardingEvent.fee)

td.text-end
Expand Down
4 changes: 2 additions & 2 deletions views/includes/shared-mixins.pug
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ mixin _valueDisplaySat(val, options={})
span.ms-1 #{largeNumberData[1].textDesc}

else
span(class=(localCurrencyDisplay ? "border-dotted" : false), title=(localCurrencyDisplay ? `${utils.formatCurrencyAmount(val, coinConfig.defaultCurrencyUnit.name.toLowerCase()).simpleVal} BTC` : false), data-bs-toggle=(localCurrencyDisplay ? "tooltip" : false)) #{parts.intVal.toLocaleString()}
span(class=(localCurrencyDisplay ? "border-dotted" : false), title=(localCurrencyDisplay ? `${utils.formatCurrencyAmount(val, coinConfig.defaultCurrencyUnit.name.toLowerCase()).simpleVal} BTC` : false), data-bs-toggle=(localCurrencyDisplay ? "tooltip" : false)) #{parts.val.toLocaleString()}


if (exchangeRates)
Expand Down Expand Up @@ -471,7 +471,7 @@ mixin _valueDisplayLocal(val, options={})
span.ms-1 #{largeNumberData[1].textDesc}

else
span.border-dotted(title=`${utils.formatCurrencyAmount(val, coinConfig.defaultCurrencyUnit.name.toLowerCase()).simpleVal} BTC`, data-bs-toggle="tooltip") #{parts.val}
span.border-dotted(title=`${utils.formatCurrencyAmount(val, coinConfig.defaultCurrencyUnit.name.toLowerCase()).simpleVal} BTC`, data-bs-toggle="tooltip") #{parts.val.toLocaleString()}


mixin valueDisplaySpecial(val, maxDecimals=-1, summarizeAlways=false, summarizeMin=Infinity, summarizeDecimals=-1)
Expand Down
2 changes: 1 addition & 1 deletion views/layout.pug
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ html
block content

if (global.adminPassword)
.rounded-circle.mt-2(style="margin-right: 1rem !important;")
.rounded-circle.mt-2(style="margin-right: .45rem !important;")
a.btn.btn-primary.btn-sm(href="javascript:void(0)", data-bs-toggle="modal", data-bs-target="#global-search")
span(title="Global search", data-bs-toggle="tooltip")
i.fas.fa-search
Expand Down

0 comments on commit 2411716

Please sign in to comment.