currencyx

package
v1.0.0-beta.228 Latest Latest
Warning

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

Go to latest
Published: May 19, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Calculator

type Calculator struct {
	Currency Code
	Def      *currency.Def
}

TODO: Better name?!

func (Calculator) IsRoundedToPrecision

func (c Calculator) IsRoundedToPrecision(amount alpacadecimal.Decimal) bool

func (Calculator) RoundToPrecision

func (c Calculator) RoundToPrecision(amount alpacadecimal.Decimal) alpacadecimal.Decimal

func (Calculator) Validate

func (c Calculator) Validate() error

type Code

type Code currency.Code

Currency represents a currency code. Three-letter [ISO4217](https://www.iso.org/iso-4217-currency-codes.html) currency code.

func (Code) Calculator

func (c Code) Calculator() (Calculator, error)

Calculator provides a currency calculator object. This allows us to not to resolve def a lot of times, plus we can assume that def is always valid, thus we can avoid a lot of error handling.

func (Code) Validate

func (c Code) Validate() error

Jump to

Keyboard shortcuts

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