Closed BeanWei closed 5 years ago
This package decode the JSON document in map[string]interface{}
, JSON number is decoded in float64
https://github.com/golang/go/blob/master/src/encoding/json/decode.go#L53
You can do it like,
func main() {
text := `{"id": 1827049}`
j := gojsonq.New().JSONString(text).Find("id")
fmt.Println("Num: ", j, "\nValue: ", fmt.Sprintf("%d", uint64(j.(float64))))
}
Output:
Num: 1.827049e+06
Value: 1827049