diff --git a/webapi/formatting.go b/webapi/formatting.go index 47d59c8..2e6a9eb 100644 --- a/webapi/formatting.go +++ b/webapi/formatting.go @@ -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() +} diff --git a/webapi/templates/admin.html b/webapi/templates/admin.html index 109c0ca..e8d6938 100644 --- a/webapi/templates/admin.html +++ b/webapi/templates/admin.html @@ -196,7 +196,7 @@ Fee Amount - {{ .Ticket.FeeAmount }} atoms + {{ atomsToDCR .Ticket.FeeAmount }} Fee Expiration diff --git a/webapi/webapi.go b/webapi/webapi.go index fc01b1e..feb12e9 100644 --- a/webapi/webapi.go +++ b/webapi/webapi.go @@ -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")