MCPcopy Create free account
hub / github.com/cronitorio/cronitor-cli / formatSiteValue

Function formatSiteValue

cmd/site.go:827–842  ·  view source on GitHub ↗
(v interface{})

Source from the content-addressed store, hash-verified

825}
826
827func formatSiteValue(v interface{}) string {
828 if v == nil {
829 return "-"
830 }
831 switch val := v.(type) {
832 case float64:
833 if val == float64(int(val)) {
834 return fmt.Sprintf("%.0f", val)
835 }
836 return fmt.Sprintf("%.2f", val)
837 case string:
838 return val
839 default:
840 return fmt.Sprintf("%v", val)
841 }
842}

Callers 4

renderAggregationTableFunction · 0.85
renderBreakdownTableFunction · 0.85
renderTimeseriesTableFunction · 0.85
renderErrorGroupsTableFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected