amount

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertCeil

func ConvertCeil(a currency.Amount, rate currency.Rate) (currency.Amount, error)

ConvertCeil performs currency conversion for given currency using given rate and rounds up result to decimal digits

func ConvertFloor

func ConvertFloor(a currency.Amount, rate currency.Rate) (currency.Amount, error)

ConvertFloor performs currency conversion for given currency using given rate and rounds down result to decimal digits

func Integer

func Integer(c currency.Short, amount int64) currency.Amount

func MultiplyCeil

func MultiplyCeil(a currency.Amount, multiplier float64) (currency.Amount, error)

MultiplyCeil applies multiplier on given amount and rounds up result to decimal digits

func MultiplyFloor

func MultiplyFloor(a currency.Amount, multiplier float64) (currency.Amount, error)

MultiplyFloor applies multiplier on given amount and rounds down result to decimal digits

func Must

func Must(amount currency.Amount, err error) currency.Amount

Must function returns amount if error is nil or panics if error present

func New

func New(currency currency.Short, amount float64) currency.Amount

func Sum

func Sum(amounts ...currency.Amount) (currency.Amount, error)

Sum performs summing of given amounts

func Zero

func Zero(c currency.Short) currency.Amount

Types

This section is empty.

Jump to

Keyboard shortcuts

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