currency

package
v0.0.0-...-d79564b Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Code

func Code(currency sumup.Currency) string

Code returns the ISO code string representation of the currency.

func Format

func Format(amount float64, currency sumup.Currency) string

Format renders an amount with a currency symbol.

func FormatPointers

func FormatPointers(amount *float32, currency *sumup.Currency) string

FormatPointers renders optional amount and currency pointers.

func Parse

func Parse(value string) (sumup.Currency, error)

Parse converts a string into a SumUp currency value.

func ParseMajorUnits32

func ParseMajorUnits32(amount string) (float32, error)

ParseMajorUnits32 converts a decimal amount string into float32 major units.

func ParseMajorUnitsForCurrency32

func ParseMajorUnitsForCurrency32(amount string, currency sumup.Currency) (float32, error)

ParseMajorUnitsForCurrency32 converts a decimal amount string into float32 major units after validating the scale for the given currency.

func ParseMajorUnitsForCurrency64

func ParseMajorUnitsForCurrency64(amount string, currency sumup.Currency) (float64, error)

ParseMajorUnitsForCurrency64 converts a decimal amount string into float64 major units after validating the scale for the given currency.

func Supported

func Supported() []string

Supported returns the currency codes understood by the CLI.

func ToMinorUnits

func ToMinorUnits(amount string, minorUnit int32) (int64, error)

ToMinorUnits converts a decimal-string amount into its minor units.

Types

This section is empty.

Jump to

Keyboard shortcuts

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