type F struct {
Amount float64 `json:"amount"`}func main() {
amount := F{9.426453e+06}
body, err := json.Marshal(amount) // 用的go自帶的json包
fmt.Println(string(body), err) // {"amount":9426453} }這個json出來把小數點后面的參數給整沒了,求大神賜教???
- 1 回答
- 0 關注
- 620 瀏覽
添加回答
舉報
0/150
提交
取消