MCPcopy Create free account
hub / github.com/APIParkLab/APIPark / FormatFloat64

Function FormatFloat64

module/monitor/driver/influxdb-v2/util.go:64–68  ·  view source on GitHub ↗

FormatFloat64 float64保留places位小数

(f float64, places int)

Source from the content-addressed store, hash-verified

62
63// FormatFloat64 float64保留places位小数
64func FormatFloat64(f float64, places int) float64 {
65 formatStr := "%." + strconv.Itoa(places) + "f"
66 f64, _ := strconv.ParseFloat(fmt.Sprintf(formatStr, f), 64)
67 return f64
68}
69
70func formatFilter(wheres []monitor.MonWhereItem) string {
71 filter := ``

Callers 4

ProxyTrendMethod · 0.85
InvokeTrendMethod · 0.85
CommonStatisticsMethod · 0.85
formatMessageTrendDataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected