1 Star 0 Fork 0

GoAdmin/sdk

Create your Gitee Account
Explore and code with more than 13.5 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
int.go 436 Bytes
Copy Edit Raw Blame History
GoAdmin authored 2022-06-08 16:52 +08:00 . test
package pkg
import (
"math"
"strconv"
)
func IntToString(e int) string {
return strconv.Itoa(e)
}
func UIntToString(e uint) string {
return strconv.Itoa(int(e))
}
func Int64ToString(e int64) string {
return strconv.FormatInt(e, 10)
}
func Round(f float64, n int) float64 {
pow10_n := math.Pow10(n)
return math.Trunc((f+0.5/pow10_n)*pow10_n) / pow10_n // TODO +0.5 是为了四舍五入,如果不希望这样去掉这个
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/GoAdminCore/sdk.git
git@gitee.com:GoAdminCore/sdk.git
GoAdminCore
sdk
sdk
v1.0.2

Search