format

package
v0.0.0-...-fd21f57 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2019 License: MIT Imports: 2 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fit

func Fit(s string, n int) string

Fit trims a string to the specified length adding ... at the end when required.

func SI

func SI(value float64, decimals int, k float64, s1, s2, s3 string) string

SI formats a value to SI and other prefixes. Use like: formatBytes(123456789, 2, 1000, ”, ”, ”) Or: formatBytes(123456789, 3, 1024, 'bytes', 'b', ' ') s1 only used when value=0, s2 is short version, s3 is separator. Does not handle negative values currently. Uses just capital letter for capitalization, not IEC/JEDEC standards.

Types

This section is empty.

Jump to

Keyboard shortcuts

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