format

package
v1.16.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 19, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package format provides shared formatting helpers for display values.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bytes

func Bytes(b float64) string

Bytes formats byte amounts: 540 B, 12.4 KB, 1.2 MB, 3.4 GB.

func Cost

func Cost(dollars float64) string

Cost formats a dollar amount: $142, $9.4k, $1.2M.

func Count

func Count(n int64) string

Count renders an integer, showing "—" for zero.

func TitleCase

func TitleCase(slug string) string

TitleCase converts a snake_case slug to Title Case. "bot_traffic" → "Bot Traffic", "pii_leakage" → "Pii Leakage".

func Volume

func Volume(eventsPerHour float64) string

Volume formats events/hr: 892, 45.3k, 2.1M.

func YearlyCost

func YearlyCost(costPerHour float64) string

YearlyCost formats an hourly USD rate as yearly: $0/yr, $1.7k/yr, $110k/yr.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL