fixed

package
v1.113.0 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: MPL-2.0 Imports: 1 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDoesNotFitInRequestedType = errors.New("does not fit in requested type")

ErrDoesNotFitInRequestedType is returned from the fixed-point CheckedAs() functions if the requested type cannot exactly represent the value.

Functions

This section is empty.

Types

type D1 added in v1.70.0

type D1 int64

D1 is used for fixed-point types with 1 decimal place.

func (D1) Multiplier added in v1.70.0

func (d D1) Multiplier() int64

Multiplier implements Dx.

func (D1) Places added in v1.70.0

func (d D1) Places() int

Places implements Dx.

type D10 added in v1.70.0

type D10 int64

D10 is used for fixed-point types with 10 decimal places.

func (D10) Multiplier added in v1.70.0

func (d D10) Multiplier() int64

Multiplier implements Dx.

func (D10) Places added in v1.70.0

func (d D10) Places() int

Places implements Dx.

type D11 added in v1.70.0

type D11 int64

D11 is used for fixed-point types with 11 decimal places.

func (D11) Multiplier added in v1.70.0

func (d D11) Multiplier() int64

Multiplier implements Dx.

func (D11) Places added in v1.70.0

func (d D11) Places() int

Places implements Dx.

type D12 added in v1.70.0

type D12 int64

D12 is used for fixed-point types with 12 decimal places.

func (D12) Multiplier added in v1.70.0

func (d D12) Multiplier() int64

Multiplier implements Dx.

func (D12) Places added in v1.70.0

func (d D12) Places() int

Places implements Dx.

type D13 added in v1.70.0

type D13 int64

D13 is used for fixed-point types with 13 decimal places.

func (D13) Multiplier added in v1.70.0

func (d D13) Multiplier() int64

Multiplier implements Dx.

func (D13) Places added in v1.70.0

func (d D13) Places() int

Places implements Dx.

type D14 added in v1.70.0

type D14 int64

D14 is used for fixed-point types with 14 decimal places.

func (D14) Multiplier added in v1.70.0

func (d D14) Multiplier() int64

Multiplier implements Dx.

func (D14) Places added in v1.70.0

func (d D14) Places() int

Places implements Dx.

type D15 added in v1.70.0

type D15 int64

D15 is used for fixed-point types with 15 decimal places.

func (D15) Multiplier added in v1.70.0

func (d D15) Multiplier() int64

Multiplier implements Dx.

func (D15) Places added in v1.70.0

func (d D15) Places() int

Places implements Dx.

type D16 added in v1.70.0

type D16 int64

D16 is used for fixed-point types with 16 decimal places.

func (D16) Multiplier added in v1.70.0

func (d D16) Multiplier() int64

Multiplier implements Dx.

func (D16) Places added in v1.70.0

func (d D16) Places() int

Places implements Dx.

type D2 added in v1.70.0

type D2 int64

D2 is used for fixed-point types with 2 decimal places.

func (D2) Multiplier added in v1.70.0

func (d D2) Multiplier() int64

Multiplier implements Dx.

func (D2) Places added in v1.70.0

func (d D2) Places() int

Places implements Dx.

type D3 added in v1.70.0

type D3 int64

D3 is used for fixed-point types with 3 decimal places.

func (D3) Multiplier added in v1.70.0

func (d D3) Multiplier() int64

Multiplier implements Dx.

func (D3) Places added in v1.70.0

func (d D3) Places() int

Places implements Dx.

type D4 added in v1.70.0

type D4 int64

D4 is used for fixed-point types with 4 decimal places.

func (D4) Multiplier added in v1.70.0

func (d D4) Multiplier() int64

Multiplier implements Dx.

func (D4) Places added in v1.70.0

func (d D4) Places() int

Places implements Dx.

type D5 added in v1.70.0

type D5 int64

D5 is used for fixed-point types with 5 decimal places.

func (D5) Multiplier added in v1.70.0

func (d D5) Multiplier() int64

Multiplier implements Dx.

func (D5) Places added in v1.70.0

func (d D5) Places() int

Places implements Dx.

type D6 added in v1.70.0

type D6 int64

D6 is used for fixed-point types with 6 decimal places.

func (D6) Multiplier added in v1.70.0

func (d D6) Multiplier() int64

Multiplier implements Dx.

func (D6) Places added in v1.70.0

func (d D6) Places() int

Places implements Dx.

type D7 added in v1.70.0

type D7 int64

D7 is used for fixed-point types with 7 decimal places.

func (D7) Multiplier added in v1.70.0

func (d D7) Multiplier() int64

Multiplier implements Dx.

func (D7) Places added in v1.70.0

func (d D7) Places() int

Places implements Dx.

type D8 added in v1.70.0

type D8 int64

D8 is used for fixed-point types with 8 decimal places.

func (D8) Multiplier added in v1.70.0

func (d D8) Multiplier() int64

Multiplier implements Dx.

func (D8) Places added in v1.70.0

func (d D8) Places() int

Places implements Dx.

type D9 added in v1.70.0

type D9 int64

D9 is used for fixed-point types with 9 decimal places.

func (D9) Multiplier added in v1.70.0

func (d D9) Multiplier() int64

Multiplier implements Dx.

func (D9) Places added in v1.70.0

func (d D9) Places() int

Places implements Dx.

type Dx added in v1.70.0

type Dx interface {
	Places() int
	Multiplier() int64
}

Dx is the constraint for allowed decimal place types. These methods must return a static value and be usable with the zero value of the type.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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