package test import ( "fmt" "strconv" "testing" ) func Test_convert(t *testing.T){ b,_ := strconv.ParseFloat("0.93312344" ,64) a,_ := strconv.ParseFloat(fmt.Sprintf("%.2f", b), 64) fmt.Println(a) }