decimal

package
v0.0.0-...-0871eb3 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Decimal

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

Decimal is Decimal

func New

func New(prec, maxScale, minScale int) *Decimal

New is to create Decimal object if 12345.12345 is expected, New(10, 5, 0) //as precision 9,16,19,34

func (*Decimal) Add

func (d *Decimal) Add(x0, y0 *dc.Big) *dc.Big

Add is to add parameter 1 and 2

func (*Decimal) BigFloat

func (d *Decimal) BigFloat(v *big.Float) *dc.Big

BigFloat is to convert big.Float to Big type

func (*Decimal) Div

func (d *Decimal) Div(x0, y0 *dc.Big) *dc.Big

Div is to divide x0 by y0

func (*Decimal) Float64

func (d *Decimal) Float64(v float64) *dc.Big

Float64 is to convert float64 to Big type

func (*Decimal) Mul

func (d *Decimal) Mul(x0, y0 *dc.Big) *dc.Big

Mul is to multiply x0 by y0

func (*Decimal) String

func (d *Decimal) String(v string) *dc.Big

String is to convert string to Big type

func (*Decimal) Sub

func (d *Decimal) Sub(x0, y0 *dc.Big) *dc.Big

Sub is to subtract y0 from x0

func (*Decimal) Uint64

func (d *Decimal) Uint64(v uint64) *dc.Big

Uint64 is to convert uint64 to Big type

Jump to

Keyboard shortcuts

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