2948 explained code solutions for 75 technologies

golangConvert float to string

package main
import "strconv"

func main() {
  var str string
  str = strconv.FormatFloat(12.3, 'f', 1, 32))
}ctrl + c

converts float to string


float value to convert to string


format of a float value (d.d in our case)

1, 32

number of digits after the point and input float size (32 bits in our case)