Discover Packages
github.com/tdewolff/parse/v2
strconv
package
Version:
v2.6.2
Opens a new window with list of versions in this module.
Published: Aug 3, 2022
License: MIT
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: 41
Opens a new window with list of known importers.
Documentation
Documentation
¶
func AppendFloat(b []byte, f float64, prec int) ([]byte, bool)
func AppendPrice(b []byte, price int64, dec bool, milSeparator byte, decSeparator byte) []byte
func LenInt(i int64) int
func ParseFloat(b []byte) (float64, int)
func ParseInt(b []byte) (int64, int)
func ParseUint(b []byte) (uint64, int)
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.
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.
LenInt returns the written length of an integer.
ParseFloat parses a byte-slice and returns the float it represents.
If an invalid character is encountered, it will stop there.
ParseInt parses a byte-slice and returns the integer it represents.
If an invalid character is encountered, it will stop there.
ParseUint parses a byte-slice and returns the integer it represents.
If an invalid character is encountered, it will stop there.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.