currencyx

package
v1.0.0-beta.219 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2025 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) RoundToPrecision

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

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