diff --git a/api/worker.go b/api/worker.go
index 14ef57cb..0dc9c983 100644
--- a/api/worker.go
+++ b/api/worker.go
@@ -97,7 +97,7 @@ func (w *Worker) GetTransaction(txid string, bestheight uint32, spendingTx bool)
Locktime: bchainTx.LockTime,
WithSpends: spendingTx,
Time: bchainTx.Time,
- Txid: txid,
+ Txid: bchainTx.Txid,
ValueIn: valIn,
ValueOut: valOut,
Version: bchainTx.Version,
diff --git a/server/public.go b/server/public.go
index b517e5fc..5476e8f2 100644
--- a/server/public.go
+++ b/server/public.go
@@ -108,7 +108,7 @@ func formatUnixTime(ut int64) string {
}
func formatAmount(a float64) string {
- return fmt.Sprintf("%0.8f", a)
+ return strings.TrimRight(strings.TrimRight(fmt.Sprintf("%0.8f", a), "0"), ".")
}
// Run starts the server
diff --git a/static/templates/txdetail.html b/static/templates/txdetail.html
index 3439f919..ee663332 100644
--- a/static/templates/txdetail.html
+++ b/static/templates/txdetail.html
@@ -22,7 +22,7 @@
{{$vin.Addr}}
{{else}}Unparsed address{{end}}
- {{$vin.Value}} {{$cs}}
+ {{formatAmount $vin.Value}} {{$cs}}
{{else}}No Inputs (Newly Generated Coins){{end}}
@@ -50,7 +50,7 @@
{{else}}
Unparsed address
{{end}}
- {{$vout.Value}} {{$cs}}
+ {{formatAmount $vout.Value}} {{$cs}}
{{end}}