Skip to content

Commit 4ea2510

Browse files
committed
Coax numbers out of scientific notation
1 parent 94b5d38 commit 4ea2510

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

restapi/common.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"github.com/hashicorp/terraform/helper/schema"
66
"log"
77
"os"
8+
"strconv"
89
"strings"
910
)
1011

@@ -119,10 +120,14 @@ func GetObjectAtKey(data map[string]interface{}, path string, debug bool) (inter
119120
}
120121

121122
if debug {
122-
log.Printf("common.go:GetObjectAtKey: %s - exists", part)
123+
log.Printf("common.go:GetObjectAtKey: %s - exists (%v)", part, hash[part])
123124
}
124125

125-
return hash[part], nil
126+
if _, ok := hash[part].(float64); ok {
127+
return strconv.FormatFloat(hash[part].(float64), 'f', -1, 64), nil
128+
} else {
129+
return hash[part], nil
130+
}
126131
}
127132

128133
/* Handy helper to just dump the keys of a map into a slice */

0 commit comments

Comments
 (0)