integer

package
v0.0.0-...-06dd36e Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func If

func If(b bool, yes int64) int64

simplified ternary operator (bool ? val : 0), returns second argument, if the condition (first arg) is true, returns 0 if not integer.If(true,3) // 3 integer.If(false,3) // 0

func IfElse

func IfElse(b bool, val1, val2 int64) int64

IfElse ternary operator (bool ? val1 : val2), returns second argument if the condition (first arg) is true, third argument if not integer.IfElse(true,3,4) // 3 integer.IfElse(false,3,4) // 4

func IfZero

func IfZero(val1, val2 int64) int64

IfZero simplified ternary operator (bool ? val1==0 : val2), returns second argument, if val1 (first arg) is zero, returns val2 if not integer.IfZero(0,3) // 3 integer.IfZero(4,3) // 4

func Int64ToString

func Int64ToString(num int64) string

Int64ToString convert int64 to string integer.Int64ToString(int64(1234)) // `1234`

func IntToString

func IntToString(num int) string

IntToString convert int to string integer.IntToString(1234) // `1234`

func IsZero

func IsZero(val1, val2 int) int

simplified ternary operator (bool ? val1==0 : val2), returns second argument, if val1 (first arg) is zero, returns val2 if not integer.IsZero(0,3) // 3 integer.IsZero(4,3) // 4

func MaxOf

func MaxOf(a, b int) int

MaxOf return int max of two values integer.MaxOf(3,4) // 4

func MaxValue

func MaxValue(a, b int64) int64

MaxValue return max of two int64 values integer.MaxValue(int64(3),int64(4)) // 4

func MinOf

func MinOf(a, b int) int

MinOf return int min of two values integer.MinOf(3,4) // 3

func MinValue

func MinValue(a, b int64) int64

MinValue return min of two int64 values integer.MinValue(int64(3),int64(4)) // 3

func PadZero

func PadZero(num int64, length int) string

PadZero converts int64 (first arg) to string with zero padded with maximum length integer.PadZero(123,5) // `00123`

func ToEnglishNum

func ToEnglishNum(num int64) string

ToEnglishNum format ordinal number suffix such as st, nd, rd, and th. integer.ToEnglishNum(241)) // `241st` integer.ToEnglishNum(242)) // `242nd` integer.ToEnglishNum(244)) // `244th`

func ToRoman

func ToRoman(num int64) string

convert int64 to roman number integer.ToRoman(16)) // output "XVI"

Types

This section is empty.

Jump to

Keyboard shortcuts

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