currency

package
v0.0.32 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: MIT Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const Default = "USD"
View Source
const WantedAmount = -1

WantedAmount is the price sentinel for a wanted listing.

View Source
const WantedFilter = "wanted"

WantedFilter is the search-filter value that selects wanted listings.

View Source
const WantedLabel = "WANTED"

WantedLabel is the display text for WantedAmount.

Variables

View Source
var Supported = []string{
	"USD", "EUR", "GBP", "CAD", "AUD", "JPY", "CHF", "CNY", "INR", "MXN",
	"BRL", "KRW", "NZD", "SEK", "NOK", "DKK", "PLN", "ZAR",
	"HKD", "SGD", "TWD", "THB", "MYR", "IDR", "PHP", "VND",
	"AED", "SAR", "ILS", "TRY", "CZK", "HUF", "RON",
	"ARS", "CLP", "COP", "PEN",
	"EGP", "NGN", "KES", "PKR", "BDT",
}

Supported lists ISO 4217 codes for the price currency dropdown.

Functions

func DefaultFromPhone

func DefaultFromPhone(phone string) string

DefaultFromPhone infers a currency code from an E.164 phone number.

func DefaultFromRegion

func DefaultFromRegion(region string) string

DefaultFromRegion maps an ISO 3166-1 alpha-2 region to a supported currency.

func Format

func Format(amount int, code string) string

Format renders a price for display. Zero is FREE. WantedAmount is WANTED.

func IsSupported

func IsSupported(code string) bool

func Normalize

func Normalize(code string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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