types

package
v5.12.4 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DecimalZero = Decimal{}

Functions

func FormatDMS added in v5.11.1

func FormatDMS(d DMS, to dms.Unit, places int) string

func FormatDuration

func FormatDuration(d time.Duration) string

func ParseDuration

func ParseDuration(str string) (time.Duration, bool)

Types

type DMS

type DMS struct {
	// contains filtered or unexported fields
}

func NewDMS

func NewDMS(deg, min, sec float64) DMS

func NewDMSFromDecimal added in v5.11.1

func NewDMSFromDecimal(deg, min, sec Decimal) DMS

func NewDMSFromFields added in v5.11.1

func NewDMSFromFields(f dms.Fields) (DMS, error)

func (DMS) Add added in v5.11.1

func (d DMS) Add(d2 DMS) DMS

func (DMS) DMS added in v5.11.1

func (d DMS) DMS() (deg, min, sec Decimal)

func (DMS) Degrees

func (d DMS) Degrees() Decimal

func (DMS) Minutes

func (d DMS) Minutes() Decimal

func (DMS) Seconds

func (d DMS) Seconds() Decimal

func (DMS) String

func (d DMS) String() string

type Decimal

type Decimal struct {
	// contains filtered or unexported fields
}

func NewDecimalFromFloat

func NewDecimalFromFloat(v float64) Decimal

func NewDecimalFromInt

func NewDecimalFromInt(v int64) Decimal

func NewDecimalFromString

func NewDecimalFromString(v string) (Decimal, error)

func (Decimal) Abs

func (d Decimal) Abs() Decimal

func (Decimal) Add

func (d Decimal) Add(d2 Decimal) Decimal

func (Decimal) Ceil

func (d Decimal) Ceil() Decimal

func (Decimal) Cmp

func (d Decimal) Cmp(d2 Decimal) int

func (Decimal) Coefficient

func (d Decimal) Coefficient() *big.Int

func (Decimal) Div

func (d Decimal) Div(d2 Decimal) Decimal

func (Decimal) Equal

func (d Decimal) Equal(d2 Decimal) bool

func (Decimal) Float

func (d Decimal) Float() float64

func (Decimal) Floor

func (d Decimal) Floor() Decimal

func (Decimal) GreaterThan

func (d Decimal) GreaterThan(d2 Decimal) bool

func (Decimal) GreaterThanOrEqual

func (d Decimal) GreaterThanOrEqual(d2 Decimal) bool

func (Decimal) Int added in v5.11.1

func (d Decimal) Int() Decimal

func (Decimal) IsInteger

func (d Decimal) IsInteger() bool

func (Decimal) IsNegative

func (d Decimal) IsNegative() bool

func (Decimal) IsPositive

func (d Decimal) IsPositive() bool

func (Decimal) IsZero

func (d Decimal) IsZero() bool

func (Decimal) LessThan

func (d Decimal) LessThan(d2 Decimal) bool

func (Decimal) LessThanOrEqual

func (d Decimal) LessThanOrEqual(d2 Decimal) bool

func (Decimal) Mod

func (d Decimal) Mod(d2 Decimal) Decimal

func (Decimal) Mul

func (d Decimal) Mul(d2 Decimal) Decimal

func (Decimal) Neg

func (d Decimal) Neg() Decimal

func (Decimal) Pow

func (d Decimal) Pow(d2 Decimal) Decimal

func (Decimal) QuoRem

func (d Decimal) QuoRem(d2 Decimal, prec int32) (Decimal, Decimal)

func (Decimal) Round

func (d Decimal) Round(places int32) Decimal

func (Decimal) RoundBank

func (d Decimal) RoundBank(places int32) Decimal

func (Decimal) RoundCeil

func (d Decimal) RoundCeil(places int32) Decimal

func (Decimal) RoundDown

func (d Decimal) RoundDown(places int32) Decimal

func (Decimal) RoundFloor

func (d Decimal) RoundFloor(places int32) Decimal

func (Decimal) RoundUp

func (d Decimal) RoundUp(places int32) Decimal

func (Decimal) Sign

func (d Decimal) Sign() int

func (Decimal) String

func (d Decimal) String() string

func (Decimal) StringRound added in v5.11.1

func (d Decimal) StringRound(places int) string

func (Decimal) Sub

func (d Decimal) Sub(d2 Decimal) Decimal

func (Decimal) Truncate

func (d Decimal) Truncate(precision int32) Decimal

Jump to

Keyboard shortcuts

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