format

package
v1.17.0 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateAbsoluteChange added in v1.11.0

func CalculateAbsoluteChange(oldVal int64, newVal int64) string

calculateAbsoluteChange calculates the absolute change between old and new values

func CalculatePercentageChange added in v1.11.0

func CalculatePercentageChange(oldVal int64, newVal int64) string

calculatePercentageChange calculates the percentage change between old and new values

func FormatBasic added in v1.1.0

func FormatBasic(value float64, lang language.Tag) string

FormatWholeNumber formats a number with thousand separators, rounding to the nearest integer. Should be used for high-value amounts where fractional parts are not relevant.

func FormatDetailed added in v1.1.0

func FormatDetailed(value float64, lang language.Tag) string

FormatSats formats a number with thousand separators and up to 3 decimal places. Should be used for fees or other fractional amounts.

func FormatDuration added in v1.6.0

func FormatDuration(d time.Duration) time.Duration

func FormatPubKey added in v1.0.0

func FormatPubKey(value string) string

FormatPubKey formats a pubkey to a shorter version

func FormatRatePPM added in v1.2.0

func FormatRatePPM(value float64, total float64, lang language.Tag) string

FormatRatePPM formats a rate as parts per million (ppm), rounding to the nearest integer. If the total is zero, it returns "0".

Types

This section is empty.

Jump to

Keyboard shortcuts

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