Help us shape the future of Go! Take the 2026 Go Developer Survey

strconv

package
v2.4.3 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2020 License: MIT Imports: 1 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendFloat

func AppendFloat(b []byte, f float64, prec int) ([]byte, bool)

AppendFloat appends a float to `b` with precision `prec`. It returns the new slice and whether succesful or not. Precision is the number of decimals to display, thus prec + 1 == number of significant digits.

func AppendPrice

func AppendPrice(b []byte, price int64, dec bool, milSeparator byte, decSeparator byte) []byte

AppendPrice will append an int64 formatted as a price, where the int64 is the price in cents. It does not display whether a price is negative or not.

func LenInt

func LenInt(i int64) int

func ParseFloat

func ParseFloat(b []byte) (float64, int)

Float parses a byte-slice and returns the float it represents. If an invalid character is encountered, it will stop there.

func ParseInt

func ParseInt(b []byte) (int64, int)

Int parses a byte-slice and returns the integer it represents. If an invalid character is encountered, it will stop there.

Types

This section is empty.

Jump to

Keyboard shortcuts

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