From 21c267ac2b6130f9dfbc441f3a7a30f82f269113 Mon Sep 17 00:00:00 2001 From: John Date: Fri, 27 Apr 2018 22:21:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3gconv.Float64=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E4=BD=8D=E5=A4=A7=E5=B0=8F=E8=AE=BE=E7=BD=AE=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- g/util/gconv/gconv.go | 2 +- geg/other/test.go | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/g/util/gconv/gconv.go b/g/util/gconv/gconv.go index a59d01780..eaad03ecc 100644 --- a/g/util/gconv/gconv.go +++ b/g/util/gconv/gconv.go @@ -229,7 +229,7 @@ func Float64 (i interface{}) float64 { if v, ok := i.(float64); ok { return v } - v, _ := strconv.ParseFloat(String(i), 32) + v, _ := strconv.ParseFloat(String(i), 64) return v } diff --git a/geg/other/test.go b/geg/other/test.go index fbf96d50a..5aa12c1dc 100644 --- a/geg/other/test.go +++ b/geg/other/test.go @@ -1,11 +1,12 @@ package main import ( - "gitee.com/johng/gf/g/util/gconv" - "math" "fmt" + "math/rand" ) func main() { - fmt.Println(gconv.String(uint(math.MaxUint64))) + for i := 0; i < 100; i++ { + fmt.Println(rand.Intn(200)) + } } \ No newline at end of file