Documentation
¶
Index ¶
- func ColorPercent(pct float64) string
- func CurrencySymbol(vs string) string
- func FormatLargeNumber(n float64, vs ...string) string
- func FormatPercent(pct float64) string
- func FormatPrice(price float64, vs ...string) string
- func FormatRank(rank int) string
- func FormatSupply(n float64) string
- func FormatSymbol(s string) string
- func PrintBanner()
- func PrintLogo()
- func PrintTable(headers []string, rows [][]string)
- func PrintWelcomeBox()
- func SanitizeCell(s string) string
- func VisibleWidth(s string) int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ColorPercent ¶
func CurrencySymbol ¶
func FormatLargeNumber ¶
func FormatPercent ¶
func FormatPrice ¶
func FormatRank ¶
FormatRank formats a market cap rank, returning "-" for zero/unranked.
func FormatSupply ¶
func FormatSymbol ¶
FormatSymbol sanitizes and uppercases a coin symbol from API data.
func PrintBanner ¶
func PrintBanner()
PrintBanner prints a compact one-line CoinGecko banner to stderr. Writing to stderr keeps stdout clean for piped data.
func PrintLogo ¶
func PrintLogo()
PrintLogo prints the full ASCII art CoinGecko logo in brand green to stderr.
func PrintTable ¶
func PrintWelcomeBox ¶
func PrintWelcomeBox()
PrintWelcomeBox prints a bordered quick-start box to stderr.
func SanitizeCell ¶
SanitizeCell strips all ANSI escape sequences and non-printable control characters from untrusted API data. Call this on API-sourced strings (names, symbols) before passing to PrintTable. Internal color formatting (e.g. ColorPercent) operates on numeric values and should NOT be sanitized.
func VisibleWidth ¶
VisibleWidth returns the display width of a string after stripping ANSI escapes.
Types ¶
This section is empty.