The problem of json coding in golang

type F struct {
    Amount float64 `json:"amount"`
}

func main() {
    amount := F{9.426453e+06}
    body, err := json.Marshal(amount)  // gojson
    fmt.Println(string(body), err)   // {"amount":9426453} 
}

this json comes out to eliminate the parameters after the decimal point. Ask for advice from God?

Jun.26,2021
Doesn't the number

denote the sixth power of
9.426453x 10? Isn't it right for
to show
9426453
.


this issue has been studied a long time ago, and the reasons for this can be found in these two articles, as well as some of the pitfalls dealt with by golang json.
https://stackoverflow.com/que.
https://ethancai.github.io/20.

the first answer to the solution stackoverfow is fine.
in fact, customizing MarshalJSON is very useful, and you can implement many of the marshal formats you want.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3b8c0-4082c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3b8c0-4082c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?