Display fee in DCR rather than atoms.

This commit is contained in:
Jamie Holdstock 2021-05-28 19:08:49 +08:00 committed by Jamie Holdstock
parent c3eeb1eb5c
commit dad662b0f0
3 changed files with 8 additions and 1 deletions

View File

@ -7,6 +7,8 @@ import (
"html/template"
"strings"
"time"
"github.com/decred/dcrd/dcrutil/v4"
)
func addressURL(blockExplorerURL string) func(string) string {
@ -47,3 +49,7 @@ func indentJSON(input string) template.HTML {
return template.HTML(indented.String())
}
func atomsToDCR(atoms int64) string {
return dcrutil.Amount(atoms).String()
}

View File

@ -196,7 +196,7 @@
</tr>
<tr>
<th>Fee Amount</th>
<td>{{ .Ticket.FeeAmount }} atoms</td>
<td>{{ atomsToDCR .Ticket.FeeAmount }}</td>
</tr>
<tr>
<th>Fee Expiration</th>

View File

@ -183,6 +183,7 @@ func router(debugMode bool, cookieSecret []byte, dcrd rpc.DcrdConnect, wallets r
"dateTime": dateTime,
"stripWss": stripWss,
"indentJSON": indentJSON,
"atomsToDCR": atomsToDCR,
})
router.LoadHTMLGlob("webapi/templates/*.html")