master
李光春 2 years ago
parent f9b3b9b223
commit 9225a59fda

@ -0,0 +1,14 @@
language: go
go:
- 1.17.x
- tip
before_install:
- go get -t -v ./...
script:
- go test -race -coverprofile=coverage.txt -covermode=atomic
after_success:
- bash <(curl -s https://codecov.io/bash)

@ -3,14 +3,16 @@
📦 Golang 扩展包
[comment]: <> (go)
[![Release](https://img.shields.io/github/release/dtapps/go-library.svg)](https://github.com/dtapps/go-library/releases/latest)
[![go](https://github.com/dtapps/go-library/actions/workflows/go.yml/badge.svg)](https://github.com/dtapps/go-library/actions/workflows/go.yml)
[![godoc](https://pkg.go.dev/badge/github.com/dtapps/go-library?status.svg)](https://pkg.go.dev/github.com/dtapps/go-library)
[![goproxy.cn](https://goproxy.cn/stats/github.com/dtapps/go-library/badges/download-count.svg)](https://goproxy.cn/stats/github.com/dtapps/go-library)
[![goreportcard.com](https://goreportcard.com/badge/github.com/dtapps/go-library)](https://goreportcard.com/report/github.com/dtapps/go-library)
[![deps.dev](https://img.shields.io/badge/deps-go-red.svg)](https://deps.dev/go/github.com%2Fdtapps%2Fgo-library)
[![Coverage Status](https://coveralls.io/repos/github/dtapps/go-library/badge.svg?branch=master)](https://coveralls.io/github/dtapps/go-library?branch=master)
[![Sourcegraph](https://sourcegraph.com/github.com/dtapps/go-library/-/badge.svg)](https://sourcegraph.com/github.com/dtapps/go-library?badge)
[![Build status](https://ci.appveyor.com/api/projects/status/d6rq6xynt8wkev5k?svg=true)](https://ci.appveyor.com/project/dtapps/go-library)
[![codecov](https://codecov.io/gh/dtapps/go-library/branch/master/graph/badge.svg?token=BrtbyKKPQX)](https://codecov.io/gh/dtapps/go-library)
#### 安装使用

@ -0,0 +1,13 @@
package float
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)
}
Loading…
Cancel
Save