strconvutil

package
v0.0.22 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func AtoiOrDefault added in v0.0.2

func AtoiOrDefault(s string, def int) int

AtoiOrDefault 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 SliceAtoi added in v0.0.12

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

SliceAtoi converts a slice of string integers.

func SliceAtoiSort added in v0.0.12

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

SliceAtoiSort converts and sorts a slice of string integers.

func SliceItoa added in v0.0.12

func SliceItoa(ints []int) []string

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