9951 explained code solutions for 126 technologies


golangConvert float to string


package main
import "strconv"

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

converts float to string

12.3

float value to convert to string

'f'

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)