number

package
v1.9.5 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2022 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	One = decimal.NewFromInt(1)
)

Functions

func Ceil

func Ceil(d decimal.Decimal, precision int32) decimal.Decimal

func Decimal

func Decimal(v string) decimal.Decimal

func Humanize

func Humanize(d decimal.Decimal) string

func Pow

func Pow(a, b decimal.Decimal) decimal.Decimal

func Sqrt

func SqrtN

func SqrtN(d decimal.Decimal, n int64) decimal.Decimal

Types

type Number

type Number = decimal.Decimal

type Values

type Values map[string]decimal.Decimal

func ParseValues

func ParseValues(input string) (Values, error)

func (Values) Add

func (v Values) Add(key string, value decimal.Decimal)

func (Values) Del

func (v Values) Del(key string)

func (Values) Div

func (v Values) Div(d decimal.Decimal) Values

func (Values) Encode

func (v Values) Encode() string

func (Values) Get

func (v Values) Get(key string) decimal.Decimal

func (Values) Keys

func (v Values) Keys() []string

func (Values) Merge

func (v Values) Merge(other Values)

func (Values) Mul

func (v Values) Mul(m decimal.Decimal) Values

func (*Values) Scan

func (v *Values) Scan(value interface{}) error

func (Values) Set

func (v Values) Set(key string, value decimal.Decimal)

func (Values) String

func (v Values) String() string

func (Values) Sum

func (v Values) Sum() decimal.Decimal

func (Values) Truncate

func (v Values) Truncate(p int32) Values

func (Values) Value

func (v Values) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

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