1 Star 0 Fork 0

linxing/youye-core

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
int.go 436 Bytes
一键复制 编辑 原始数据 按行查看 历史
Mark 提交于 2023-12-23 11:58 . init
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 是为了四舍五入,如果不希望这样去掉这个
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/linxing_3/youye-core.git
git@gitee.com:linxing_3/youye-core.git
linxing_3
youye-core
youye-core
v0.0.1-202404261217

搜索帮助