Skip to content

Commit b223215

Browse files
authored
Display output in human readable format (#95)
1 parent 3293b74 commit b223215

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

cmd/output.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,12 @@ func jsonify(value interface{}, format string) string {
4646
value = string(jsonStr)
4747
}
4848
}
49-
return fmt.Sprintf("%v", value)
49+
switch value.(type) {
50+
case float64, float32:
51+
return fmt.Sprintf("%.f", value)
52+
default:
53+
return fmt.Sprintf("%v", value)
54+
}
5055
}
5156

5257
func printJSON(response map[string]interface{}) {

0 commit comments

Comments
 (0)