摘要:
1. 统计模块耗时 start := time.Now() // 代码块 e.timeCost = time.Since(start).Seconds() cost := fmt.Sprintf("%.3f", e.timeCost) 2. 时间格式化 阅读全文
posted @ 2021-06-19 06:26
骑着蜗牛看海呀
阅读(170)
评论(0)
推荐(0)
摘要:
1. float64保留2位小数 加上 0.5是为了四舍五入,想保留几位小数的话把2改掉即可 func Decimal(value float64) float64 { value, _ = strconv.ParseFloat(fmt.Sprintf("%.2f", value), 64) ret 阅读全文
posted @ 2021-06-19 06:23
骑着蜗牛看海呀
阅读(502)
评论(0)
推荐(0)

浙公网安备 33010602011771号