This is an automated email from the ASF dual-hosted git repository.

rohit pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudstack-cloudmonkey.git


The following commit(s) were added to refs/heads/main by this push:
     new b223215  Display output in human readable format (#95)
b223215 is described below

commit b223215da8374326b2c60649b028f969a2ac2011
Author: Pearl Dsilva <[email protected]>
AuthorDate: Tue Aug 31 11:08:08 2021 +0530

    Display output in human readable format (#95)
---
 cmd/output.go | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

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 @@ func jsonify(value interface{}, format string) string {
                        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{}) {

Reply via email to