Documentation ¶
Index ¶
- func If(b bool, yes int64) int64
- func IfElse(b bool, val1, val2 int64) int64
- func IfZero(val1, val2 int64) int64
- func Int64ToString(num int64) string
- func IntToString(num int) string
- func IsZero(val1, val2 int) int
- func MaxOf(a, b int) int
- func MaxValue(a, b int64) int64
- func MinOf(a, b int) int
- func MinValue(a, b int64) int64
- func PadZero(num int64, length int) string
- func ToEnglishNum(num int64) string
- func ToRoman(num int64) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func If ¶
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 ¶
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 ¶
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 ¶
Int64ToString convert int64 to string integer.Int64ToString(int64(1234)) // `1234`
func IntToString ¶
IntToString convert int to string integer.IntToString(1234) // `1234`
func IsZero ¶
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 PadZero ¶
PadZero converts int64 (first arg) to string with zero padded with maximum length integer.PadZero(123,5) // `00123`
func ToEnglishNum ¶
ToEnglishNum format ordinal number suffix such as st, nd, rd, and th. integer.ToEnglishNum(241)) // `241st` integer.ToEnglishNum(242)) // `242nd` integer.ToEnglishNum(244)) // `244th`
Types ¶
This section is empty.