commit | b223215da8374326b2c60649b028f969a2ac2011 | [log] [tgz] |
---|---|---|
author | Pearl Dsilva <pearl1594@gmail.com> | Tue Aug 31 11:08:08 2021 +0530 |
committer | GitHub <noreply@github.com> | Tue Aug 31 11:08:08 2021 +0530 |
tree | efe3c2a3d84d8eb70eb9d33634b66308e862d4b8 | |
parent | 3293b74bf05617e795cbb64b0e429a35a546ce85 [diff] |
Display output in human readable format (#95)
diff --git a/cmd/output.go b/cmd/output.go index f221e03..9a02369 100644 --- a/cmd/output.go +++ b/cmd/output.go
@@ -46,7 +46,12 @@ value = string(jsonStr) } } - return fmt.Sprintf("%v", value) + switch value.(type) { + case float64, float32: + return fmt.Sprintf("%.f", value) + default: + return fmt.Sprintf("%v", value) + } } func printJSON(response map[string]interface{}) {