I'm unmarshaling a remote call as a string and I would like to save it locally as a float32.
The string is 22.600 and when I parse that:
func parseFloat(toParse string) float32 {
f, _ := strconv.ParseFloat(toParse, 32)
return float32(f)
}
I get 22.600000381469727
. Of course, that is not what I would like. How can I get a ParseFloat to exactly give me 22.600?