MCPcopy Create free account
hub / github.com/docker/docker-agent / percentLabel

Function percentLabel

cmd/root/agent_picker.go:772–775  ·  view source on GitHub ↗

percentLabel formats a scroll fraction (0..1) as a percentage string.

(frac float64)

Source from the content-addressed store, hash-verified

770
771// percentLabel formats a scroll fraction (0..1) as a percentage string.
772func percentLabel(frac float64) string {
773 pct := min(max(int(frac*100), 0), 100)
774 return strconv.Itoa(pct) + "%"
775}
776
777// isLocalConfigRef reports whether ref points at a local agent config file
778// (as opposed to a built-in name, OCI image, or URL).

Callers 2

renderDetailsMethod · 0.85
TestPercentLabelFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestPercentLabelFunction · 0.68