fct

package
v1.0.21 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnyCompare

func AnyCompare(left any, operator string, right any) (bool, error)

supported operator: ==, !=, <, <=, >, >=

func Compare

func Compare(left FCT, operator string, right FCT) (bool, error)

supported operator: ==, !=, <, <=, >, >=

func UnsafeAnyCompare added in v1.0.15

func UnsafeAnyCompare(left any, operator string, right any) bool

supported operator: ==, !=, <, <=, >, >=

func UnsafeCompare added in v1.0.15

func UnsafeCompare(left FCT, operator string, right FCT) bool

supported operator: ==, !=, <, <=, >, >=

Types

type FCT

type FCT struct {
	// contains filtered or unexported fields
}
var (
	Zero FCT
)

func AnyCalc2 added in v1.0.15

func AnyCalc2(v1 any, operator1 string, v2 any) (FCT, error)

supported operator: +, -, *, /, %

func AnyCalc3 added in v1.0.15

func AnyCalc3(v1 any, operator1 string, v2 any, operator2 string, v3 any) (FCT, error)

supported operator: +, -, *, /, %

func AnyCalc4 added in v1.0.15

func AnyCalc4(v1 any, operator1 string, v2 any, operator2 string, v3 any, operator3 string, v4 any) (FCT, error)

supported operator: +, -, *, /, %

func AnyCalc5 added in v1.0.15

func AnyCalc5(v1 any, operator1 string, v2 any, operator2 string, v3 any, operator3 string, v4 any, operator4 string, v5 any) (FCT, error)

supported operator: +, -, *, /, %

func AnyCalc6 added in v1.0.15

func AnyCalc6(v1 any, operator1 string, v2 any, operator2 string, v3 any, operator3 string, v4 any, operator4 string, v5 any, operator5 string, v6 any) (FCT, error)

supported operator: +, -, *, /, %

func Calc2

func Calc2(v1 FCT, operator1 string, v2 FCT) (FCT, error)

supported operator: +, -, *, /, %

func Calc3

func Calc3(v1 FCT, operator1 string, v2 FCT, operator2 string, v3 FCT) (FCT, error)

supported operator: +, -, *, /, %

func Calc4

func Calc4(v1 FCT, operator1 string, v2 FCT, operator2 string, v3 FCT, operator3 string, v4 FCT) (FCT, error)

supported operator: +, -, *, /, %

func Calc5

func Calc5(v1 FCT, operator1 string, v2 FCT, operator2 string, v3 FCT, operator3 string, v4 FCT, operator4 string, v5 FCT) (FCT, error)

supported operator: +, -, *, /, %

func Calc6

func Calc6(v1 FCT, operator1 string, v2 FCT, operator2 string, v3 FCT, operator3 string, v4 FCT, operator4 string, v5 FCT, operator5 string, v6 FCT) (FCT, error)

supported operator: +, -, *, /, %

func New

func New(val any, dval ...FCT) (*FCT, error)

func UnsafeAnyCalc2 added in v1.0.15

func UnsafeAnyCalc2(v1 any, operator1 string, v2 any) FCT

supported operator: +, -, *, /, %

func UnsafeAnyCalc3 added in v1.0.15

func UnsafeAnyCalc3(v1 any, operator1 string, v2 any, operator2 string, v3 any) FCT

func UnsafeAnyCalc4 added in v1.0.15

func UnsafeAnyCalc4(v1 any, operator1 string, v2 any, operator2 string, v3 any, operator3 string, v4 any) FCT

supported operator: +, -, *, /, %

func UnsafeAnyCalc5 added in v1.0.15

func UnsafeAnyCalc5(v1 any, operator1 string, v2 any, operator2 string, v3 any, operator3 string, v4 any, operator4 string, v5 any) FCT

supported operator: +, -, *, /, %

func UnsafeAnyCalc6 added in v1.0.15

func UnsafeAnyCalc6(v1 any, operator1 string, v2 any, operator2 string, v3 any, operator3 string, v4 any, operator4 string, v5 any, operator5 string, v6 any) FCT

supported operator: +, -, *, /, %

func UnsafeCalc2 added in v1.0.15

func UnsafeCalc2(v1 FCT, operator1 string, v2 FCT) FCT

supported operator: +, -, *, /, %

func UnsafeCalc3 added in v1.0.15

func UnsafeCalc3(v1 FCT, operator1 string, v2 FCT, operator2 string, v3 FCT) FCT

func UnsafeCalc4 added in v1.0.15

func UnsafeCalc4(v1 FCT, operator1 string, v2 FCT, operator2 string, v3 FCT, operator3 string, v4 FCT) FCT

supported operator: +, -, *, /, %

func UnsafeCalc5 added in v1.0.15

func UnsafeCalc5(v1 FCT, operator1 string, v2 FCT, operator2 string, v3 FCT, operator3 string, v4 FCT, operator4 string, v5 FCT) FCT

supported operator: +, -, *, /, %

func UnsafeCalc6 added in v1.0.15

func UnsafeCalc6(v1 FCT, operator1 string, v2 FCT, operator2 string, v3 FCT, operator3 string, v4 FCT, operator4 string, v5 FCT, operator5 string, v6 FCT) FCT

supported operator: +, -, *, /, %

func UnsafeNew

func UnsafeNew(val any, dval ...FCT) FCT

be careful, unsafe perform panic if theres an error

func UnsafePtrNew

func UnsafePtrNew(val any, dval ...FCT) *FCT

be careful, unsafe perform panic if theres an error

func (*FCT) Ceil

func (slf *FCT) Ceil(places int, dval ...FCT) (FCT, error)

func (*FCT) Float64

func (slf *FCT) Float64(dval ...FCT) (float64, error)

func (*FCT) Floor

func (slf *FCT) Floor(places int, dval ...FCT) (FCT, error)

func (*FCT) Get

func (slf *FCT) Get(dval FCT) FCT

func (FCT) MarshalJSON

func (slf FCT) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface.

func (*FCT) Pow

func (slf *FCT) Pow(val any, dval ...FCT) (FCT, error)

func (*FCT) PtrCeil

func (slf *FCT) PtrCeil(places int, dval ...FCT) (*FCT, error)

func (*FCT) PtrFloat64

func (slf *FCT) PtrFloat64(dval ...FCT) (*float64, error)

func (*FCT) PtrFloor

func (slf *FCT) PtrFloor(places int, dval ...FCT) (*FCT, error)

func (*FCT) PtrPow

func (slf *FCT) PtrPow(val any, dval ...FCT) (*FCT, error)

func (*FCT) PtrRound

func (slf *FCT) PtrRound(places int, dval ...FCT) (*FCT, error)

func (*FCT) PtrTruncate

func (slf *FCT) PtrTruncate(places int, dval ...FCT) (*FCT, error)

func (*FCT) Round

func (slf *FCT) Round(places int, dval ...FCT) (FCT, error)

func (*FCT) Scan

func (slf *FCT) Scan(value any) error

Scan implements the sql.Scanner interface for database deserialization.

func (*FCT) ToString

func (slf *FCT) ToString() (string, error)

func (*FCT) ToStringTrim added in v1.0.16

func (slf *FCT) ToStringTrim() (string, error)

func (*FCT) Truncate

func (slf *FCT) Truncate(places int, dval ...FCT) (FCT, error)

func (*FCT) UnmarshalJSON

func (slf *FCT) UnmarshalJSON(decimalBytes []byte) error

UnmarshalJSON implements the json.Unmarshaler interface.

func (*FCT) UnsafeCeil

func (slf *FCT) UnsafeCeil(places int, dval ...FCT) FCT

be careful, unsafe perform panic if theres an error

func (*FCT) UnsafeFloat64

func (slf *FCT) UnsafeFloat64(dval ...FCT) float64

be careful, unsafe perform panic if theres an error

func (*FCT) UnsafeFloor

func (slf *FCT) UnsafeFloor(places int, dval ...FCT) FCT

be careful, unsafe perform panic if theres an error

func (*FCT) UnsafePow

func (slf *FCT) UnsafePow(val any, dval ...FCT) FCT

be careful, unsafe perform panic if theres an error

func (*FCT) UnsafePtrCeil

func (slf *FCT) UnsafePtrCeil(places int, dval ...FCT) *FCT

be careful, unsafe perform panic if theres an error

func (*FCT) UnsafePtrFloat64

func (slf *FCT) UnsafePtrFloat64(dval ...FCT) *float64

be careful, unsafe perform panic if theres an error

func (*FCT) UnsafePtrFloor

func (slf *FCT) UnsafePtrFloor(places int, dval ...FCT) *FCT

be careful, unsafe perform panic if theres an error

func (*FCT) UnsafePtrPow

func (slf *FCT) UnsafePtrPow(val any, dval ...FCT) *FCT

be careful, unsafe perform panic if theres an error

func (*FCT) UnsafePtrRound

func (slf *FCT) UnsafePtrRound(places int, dval ...FCT) *FCT

be careful, unsafe perform panic if theres an error

func (*FCT) UnsafePtrTruncate

func (slf *FCT) UnsafePtrTruncate(places int, dval ...FCT) *FCT

be careful, unsafe perform panic if theres an error

func (*FCT) UnsafeRound

func (slf *FCT) UnsafeRound(places int, dval ...FCT) FCT

be careful, unsafe perform panic if theres an error

func (*FCT) UnsafeToString

func (slf *FCT) UnsafeToString() string

be careful, unsafe perform panic if theres an error

func (*FCT) UnsafeToStringTrim added in v1.0.16

func (slf *FCT) UnsafeToStringTrim() string

be careful, unsafe perform panic if theres an error

func (*FCT) UnsafeTruncate

func (slf *FCT) UnsafeTruncate(places int, dval ...FCT) FCT

be careful, unsafe perform panic if theres an error

func (FCT) Value

func (slf FCT) Value() (driver.Value, error)

Value implements the driver.Valuer interface for database serialization.

Jump to

Keyboard shortcuts

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