package strconv
import "github.com/tdewolff/parse/v2/strconv"
Index ¶
- func AppendFloat(b []byte, f float64, prec int) ([]byte, bool)
- func AppendNumber(b []byte, price int64, dec int, groupSize int, groupSym rune, decSym rune) []byte
- func LenInt(i int64) int
- func LenUint(i uint64) int
- func ParseDecimal(b []byte) (float64, int)
- func ParseFloat(b []byte) (float64, int)
- func ParseInt(b []byte) (int64, int)
- func ParseNumber(b []byte, groupSym rune, decSym rune) (int64, int, int)
- func ParseUint(b []byte) (uint64, int)
Functions ¶
func AppendFloat ¶
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 ¶
AppendNumber will append an int64 formatted as a number with the given number of decimal digits.
func LenInt ¶
LenInt returns the written length of an integer.
func LenUint ¶
func ParseDecimal ¶
ParseDecimal parses number of the format 1.2
func ParseFloat ¶
ParseFloat parses a byte-slice and returns the float it represents. If an invalid character is encountered, it will stop there.
func ParseInt ¶
ParseInt parses a byte-slice and returns the integer it represents. If an invalid character is encountered, it will stop there.
func ParseNumber ¶
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 ¶
ParseUint parses a byte-slice and returns the integer it represents. If an invalid character is encountered, it will stop there.
Source Files ¶
decimal.go float.go int.go number.go
- Version
- v2.7.20 (latest)
- Published
- Jan 28, 2025
- Platform
- linux/amd64
- Imports
- 2 packages
- Last checked
- 1 day ago –
Tools for package owners.