strconv

package
v2.7.13 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: MIT Imports: 2 Imported by: 33

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 successful or not. Precision is the number of decimals to display, thus prec + 1 == number of significant digits.

func AppendNumber added in v2.7.0

func AppendNumber(b []byte, price int64, dec int, groupSize int, groupSym rune, decSym rune) []byte

AppendNumber will append an int64 formatted as a number with the given number of decimal digits.

func LenInt

func LenInt(i int64) int

LenInt returns the written length of an integer.

func LenUint added in v2.7.0

func LenUint(i uint64) int

func ParseDecimal added in v2.6.7

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

ParseDecimal parses number of the format 1.2

func ParseFloat

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

ParseFloat 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)

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

func ParseNumber added in v2.7.0

func ParseNumber(b []byte, groupSym rune, decSym rune) (int64, int, int)

ParseNumber parses a byte-slice and returns the number it represents and the amount of decimals. If an invalid character is encountered, it will stop there.

func ParseUint added in v2.5.28

func ParseUint(b []byte) (uint64, int)

ParseUint 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