- init
continuous-integration/drone/push Build is failing Details
continuous-integration/drone/tag Build is passing Details

master v1.0.0
李光春 2 years ago
commit 9f96ffb669

@ -0,0 +1,17 @@
kind: pipeline
type: docker
name: clone
steps:
- name: Test
image: golang:1.18
commands:
- go env -w GO111MODULE=on
- go env -w GOPROXY=https://goproxy.cn,direct
- go test -v ./...
- name: Benchmark
image: golang:1.18
commands:
- go env -w GO111MODULE=on
- go env -w GOPROXY=https://goproxy.cn,direct
- go test -bench=. -benchmem

9
.gitignore vendored

@ -0,0 +1,9 @@
.env
.git
.svn
.idea
.vscode
*.log
goinit.sh
gomod.sh
/vendor/

@ -0,0 +1,3 @@
module go.dtapp.net/gofloat
go 1.18

@ -0,0 +1,13 @@
package gofloat
import "math"
// ToInt64 将float64转成精确的int64
func ToInt64(num float64, retain int) int64 {
return int64(num * math.Pow10(retain))
}
// ToFloat64 精准float64
func ToFloat64(num float64, retain int) float64 {
return num * math.Pow10(retain)
}

@ -0,0 +1,3 @@
package gofloat
const Version = "1.0.0"

@ -0,0 +1,7 @@
package gofloat
import "testing"
func TestVersion(t *testing.T) {
t.Log(Version)
}
Loading…
Cancel
Save