demo_test.go 206 B

12345678910111213
  1. package test
  2. import (
  3. "fmt"
  4. "strconv"
  5. "testing"
  6. )
  7. func Test_convert(t *testing.T){
  8. b,_ := strconv.ParseFloat("0.93312344" ,64)
  9. a,_ := strconv.ParseFloat(fmt.Sprintf("%.2f", b), 64)
  10. fmt.Println(a)
  11. }