Add some percision

This commit is contained in:
Amarpreet Minhas 2022-07-04 22:00:44 -04:00
parent a996bff772
commit 959035e8b2

View file

@ -92,13 +92,13 @@ func getData(query []string) string {
json.NewDecoder(resp.Body).Decode(&coin)
c := coin[0]
const output = `%s (%s)
Current Price: $%f
Current Price: $%.4f
Market Ca: $%.0f
24 Hour Volume: $%.0f
24 Hour High: $%f
24 Hour Low: $%f
All Time High: $%f
All Time Low: $%f`
24 Hour High: $%.4f
24 Hour Low: $%.4f
All Time High: $%.4f
All Time Low: $%.4f`
return fmt.Sprintf(output, c.Id, c.Symbol, c.CurrentPrice, c.MarketCap, c.TotalVolume, c.High24, c.Low24, c.ATH, c.ATL)
}