number

package
v0.0.0-...-f1b77b8 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2022 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

View Source
const (
	MultiplierDefault = 1000000000
)

Variables

View Source
var (
	ErrorFloatConversion  = errors.New("unable to convert float with rounding")
	ErrorPrecisionToSmall = errors.New("precision must be a greater then 0")
)

Functions

func FormatAmount

func FormatAmount(amount float64) float64

func GetPercentPartFromAmount

func GetPercentPartFromAmount(amount, rate float64) float64

func ToFixed

func ToFixed(num float64, precision int) float64

func ToPrecise

func ToPrecise(val float64) float64

Types

type Money

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

func New

func New() *Money

func (*Money) Round

func (m *Money) Round(val float64, precision int64) (float64, error)

Jump to

Keyboard shortcuts

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