Question : go convert floating point number, to a string, with decimal digits.
Answered by : mackerel
s := fmt.Sprintf("%.2f", x)
Source : | Last Update : Wed, 03 Mar 21
Question : go convert a string (with decimals) to a floating point number.
Answered by : mackerel
f, err := strconv.ParseFloat(s, 64)
Source : | Last Update : Wed, 03 Mar 21