Documentation
¶
Overview ¶
Package format provides shared formatting utilities for numeric values and strings. It handles formatting of bytes (with binary prefixes), percentages, time durations, generic numeric values with SI suffixes (K, M, G, T), and string truncation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BytesShort ¶
BytesShort formats bytes to short human-readable form for axis labels.
func Truncate ¶ added in v0.7.0
Truncate truncates a string to maxLen characters with ellipsis. If the string is shorter than maxLen, it is returned unchanged.
func Value ¶
Value formats a numeric value with appropriate units. Handles percentages, bytes, time units, and generic values.
func YAxisValue ¶
YAxisValue formats a value for Y axis labels with appropriate SI suffixes.
Types ¶
This section is empty.