currencyutil

package
v1.3.4 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SymbolMap = map[string]string{
	"AFN": "؋",
	"ARS": "$",
	"AWG": "ƒ",
	"BRL": "R$",
	"CAD": "$",
	"CLP": "$",
	"CNY": "¥",
	"CRC": "₡",
	"CUP": "₱",
	"EGP": "£",
	"EUR": "€",
	"FKP": "£",
	"GBP": "£",
	"ILS": "₪",
	"IRR": "﷼",
	"JPY": "¥",
	"KHR": "៛",
	"KLR": "₨",
	"KPW": "₩",
	"KRW": "₩",
	"MNT": "₮",
	"NGN": "₦",
	"NOK": "kr",
	"PHP": "₱",
	"PLN": "zł",
	"RUB": "₽",
	"SAR": "﷼",
	"THB": "฿",
	"UAH": "₴",
	"USD": "$",
	"UZS": "лв",
	"VND": "₫",
	"YER": "﷼"}

Functions

func FormatMoney

func FormatMoney(symbol string, amount float64, precision int) string

func Symbol

func Symbol(iso4217 string) (string, error)

func SymbolPrefix

func SymbolPrefix(iso4217 string) string

Types

type Formatter

type Formatter struct {
	Accounting           accounting.Accounting
	SymbolPrefix         string
	DefaultISOCode       string
	PrefixCodeDefault    bool
	PrefixCodeNonDefault bool
}

func NewFormatter

func NewFormatter(symbol string) Formatter

func (*Formatter) FormatMoney

func (f *Formatter) FormatMoney(symbol string, amount float64) string

func (*Formatter) FormatMoneyString

func (f *Formatter) FormatMoneyString(symbol string, amountString string) (string, error)

Jump to

Keyboard shortcuts

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