strconvutil

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RxPlus = regexp.MustCompile(`^\+`)

Functions

func AtoiWithDefault

func AtoiWithDefault(s string, def int) int

AtoiWithDefault is like Atoi but takes a default value which it returns in the event of a parse error.

func ChangeToFunnelPct

func ChangeToFunnelPct(v float64) float64

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

func ChangeToXoXPct

func ChangeToXoXPct(v float64) float64

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

func Commify

func Commify(n int64) string

Commify takes an int64 and adds comma for every thousand Stack Overflow: http://stackoverflow.com/users/1705598/icza URL: http://stackoverflow.com/questions/13020308/how-to-fmt-printf-an-integer-with-thousands-comma

func FormatFloat64ToAnyString

func FormatFloat64ToAnyString(v float64, pattern string) string

FormatFloat64ToAnyString is used for XoX growth.

func FormatFloat64ToAnyStringFunnel

func FormatFloat64ToAnyStringFunnel(v float64, pattern string) string

FormatFloat64ToAnyStringFunnel is used for funnels.

func FormatFloat64ToIntString

func FormatFloat64ToIntString(v float64) string

func FormatFloat64ToIntStringFunnel

func FormatFloat64ToIntStringFunnel(v float64) string

func Int64Abbreviation

func Int64Abbreviation(val int64) string

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

func Int64Len

func Int64Len(val int64) int

Int64Len returns the length of an Int64 number.

func MustParseBool

func MustParseBool(s string) bool

func MustParseE164ToInt

func MustParseE164ToInt(s string) int

func MustParseInt

func MustParseInt(s string) int

func SliceStringToInt

func SliceStringToInt(strings []string) ([]int, error)

SliceStringToInt converts a slice of string integers.

func SliceStringToIntSort

func SliceStringToIntSort(strings []string) ([]int, error)

SliceStringToIntSort converts and sorts a slice of string integers.

Types

type Float64ToString

type Float64ToString func(float64) string

Float64ToString is a function type to define functions.

type Int64ToString

type Int64ToString func(int64) string

Int64ToString is a function type to define functions.

Jump to

Keyboard shortcuts

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