Ai
3 Star 5 Fork 6

三三物联网/ssiot-core

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
int.go 436 Bytes
一键复制 编辑 原始数据 按行查看 历史
三三物联网 提交于 2022-12-29 09:28 +08:00 . up
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 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/sansaniot/ssiot-core.git
git@gitee.com:sansaniot/ssiot-core.git
sansaniot
ssiot-core
ssiot-core
v1.5.0

搜索帮助