Movatterモバイル変換


[0]ホーム

URL:


strconvutil

package
v0.71.10Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2025 License:MITImports:11Imported by:35

Details

Repository

github.com/grokify/mogo

Links

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (ErrValueIsNegative   =errors.New("value is negative")ErrValueIsOutOfRange =errors.New("value is out of range"))
View Source
var RxPlus =regexp.MustCompile(`^\+`)

Functions

funcAnyToStringadded inv0.68.4

func AnyToString(vany)string

funcAtofadded inv0.63.8

func Atof(sstring, bitSizeIs32bool) (float64,error)

funcAtofFuncadded inv0.63.8

func AtofFunc(funcStringToFloat func(sstring) (float64,error), sstring) (float64,error)

funcAtofMoreadded inv0.63.8

func AtofMore(sstring, bitSizeIs32bool, commastring) (float64,error)

funcAtoi16added inv0.37.1

func Atoi16(sstring) (int16,error)

funcAtoi32added inv0.37.1

func Atoi32(sstring) (int32,error)

funcAtoi8added inv0.37.1

func Atoi8(sstring) (int8,error)

funcAtoiFuncadded inv0.63.8

func AtoiFunc(funcStringToInt64 func(sstring) (int,error), sstring) (int,error)

funcAtoiLang

func AtoiLang(lang, sstring) (int,error)

AtoiLang provides language parsing to handlethousands separators.Number formats:https://docs.oracle.com/cd/E19455-01/806-0169/overview-9/index.html

funcAtoiMoreadded inv0.39.0

func AtoiMore(s, comma, decimalstring) (int,error)

funcAtoiMoreFuncadded inv0.63.8

func AtoiMoreFunc(comma, decimalstring) func(sstring) (int,error)

funcAtoiOrDefault

func AtoiOrDefault(sstring, defint)int

AtoiOrDefault is like Atoi but takes a default valuewhich it returns in the event of a parse error.

funcAtouadded inv0.61.0

func Atou(sstring) (uint,error)

funcAtou16added inv0.69.3

func Atou16(sstring) (uint16,error)

funcAtou32added inv0.69.0

func Atou32(sstring) (uint32,error)

funcBtoaadded inv0.64.3

func Btoa(bbool)string

Btoa returns "true" or "false" according to the value of b.

funcCanonicalIntStringOrIgnoreadded inv0.39.0

func CanonicalIntStringOrIgnore(s, comma, decimalstring)string

funcChangeToFunnelPct

func ChangeToFunnelPct(ffloat64)float64

ChangeToFunnelPct converts a 1.0 == 100% based `float64` to a Funnel percentage `float64`.

funcChangeToXoXPct

func ChangeToXoXPct(ffloat64)float64

ChangeToXoXPct converts a 1.0 == 100% based `float64` to a XoX percentage `float64`.

funcCommify

func Commify(nint64)string

Commify takes an int64 and adds comma for every thousand

funcDecimalSeparator

func DecimalSeparator(langstring) (string,error)

funcFormatBoolMoreadded inv0.55.0

func FormatBoolMore(bbool, trueVal, falseValstring)string

funcFormatDecimaladded inv0.42.0

func FormatDecimal[Nconstraints.Float |constraints.Integer](v N, precisionint)string

funcFormatFloat64ToAnyString

func FormatFloat64ToAnyString(ffloat64, patternstring)string

FormatFloat64ToAnyString is used for XoX growth.

funcFormatFloat64ToAnyStringFunnel

func FormatFloat64ToAnyStringFunnel(ffloat64, patternstring)string

FormatFloat64ToAnyStringFunnel is used for funnels.

funcFormatFloat64ToIntString

func FormatFloat64ToIntString(ffloat64)string

funcFormatFloat64ToIntStringFunnel

func FormatFloat64ToIntStringFunnel[Fconstraints.Float](f F)string

funcFtoaadded inv0.63.1

func Ftoa[Fconstraints.Float](f F, precint)string

funcInt64Abbreviation

func Int64Abbreviation(valint64)string

Int64Abbreviation returns integer abbreviations. For example,"1.5K", "15K", "150K", "1.5M", "15M", "150M".

funcInt64Len

func Int64Len(valint64)int

Int64Len returns the length of an Int64 number.

funcItoaadded inv0.50.0

func Itoa[Econstraints.Integer](e E)string

Itoa is like `strconv.Itoa()` with the additional functionality of converting `uint64` and acceptinginteger types natively via `constraints.Integer`.

funcJoinBytesadded inv0.65.6

func JoinBytes(data []string, sep []byte) []byte

JoinBytes joins a slice of strings and returns a byte array.

funcMustParseBool

func MustParseBool(sstring)bool

funcMustParseE164ToInt

func MustParseE164ToInt(sstring)int

funcMustParseInt

func MustParseInt(sstring)int

funcParseIntsadded inv0.71.9

func ParseInts(inputstring) ([]int,error)

ParseInts parses all integers from a string, ignoring non-digit separators

funcParseUint8added inv0.68.9

func ParseUint8(sstring, baseint) (uint8,error)

ParseUint8 safely parses a string into a uint8 value.It returns an error if the string is not a valid numberor if the number is out of the uint8 range.

funcSliceAtofadded inv0.63.0

func SliceAtof(s []string, bitSizeint) ([]float64,error)

funcSliceAtoi

func SliceAtoi(s []string, dedupe, sortbool) ([]int,error)

SliceAtoi converts a slice of string integers.

funcSliceAtotFuncadded inv0.63.8

func SliceAtotFunc(funcFormat func(sstring) (time.Time,error), s []string) ([]time.Time,error)

funcSliceAtouadded inv0.61.1

func SliceAtou(s []string, dedupe, sortbool) ([]uint,error)

funcSliceItoa

func SliceItoa[S ~[]E, Econstraints.Integer](s S) []string

SliceItoa converts a slice of `constraints.Integer` to a slice of `string`.

funcSliceItoaMoreadded inv0.63.1

func SliceItoaMore[S ~[]E, Econstraints.Integer](s S, dedupe, sortbool) []string

SliceItoaMore converts a slice of `constraints.Integer` to a slice of `string` with additionalfunctionality to dedupe and sort.

funcThousandsSeparator

func ThousandsSeparator(langstring) (string,error)

funcUnquoteMoreadded inv0.56.0

func UnquoteMore(sstring) (string,error)

UnquoteMore wraps `strconv.Unquote()` with additional functionality of allowing more chracterswithin single quotes.`

funcUnquoteMoreOrNotadded inv0.56.0

func UnquoteMoreOrNot(sstring)string

UnquoteMoreOrNot wraps `UnquoteMore()`

Types

typeFloat64ToString

type Float64ToString func(float64)string

Float64ToString is a function type to define functions.

typeInt64ToString

type Int64ToString func(int64)string

Int64ToString is a function type to define functions.

Source Files

View all Source files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp