fct

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: MIT Imports: 10 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 UnsecureAnyCompare

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

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

func UnsecureCompare

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

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

Types

type FCT

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

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 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) 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) 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