Skip to content

Commit

Permalink
Also display difference as a percentage
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenwilkin committed Aug 5, 2020
1 parent 8767012 commit b487b89
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cmd/btc_thb/btc_thb.go
Expand Up @@ -28,10 +28,12 @@ func main() {

equivalent := btcThb / usdThb
difference := equivalent - btcUsdt
percentage := (difference / btcUsdt) * 100

fmt.Printf("BTCTHB: %.2f\n", btcThb)
fmt.Printf("USDTHB: %.2f\n", usdThb)
fmt.Printf("Equiv: %.2f\n", equivalent)
fmt.Printf("BTCUSDT: %.2f\n", btcUsdt)
fmt.Printf("Diff: %.2f\n", difference)
fmt.Printf(" %.2f%%\n", percentage)
}

0 comments on commit b487b89

Please sign in to comment.