status-go/vendor/github.com/ladydascalie/currency/README.md

30 lines
649 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# currency
This package generates structs containing all the up-to-date `ISO4217` currency codes and minor units, along with a very simple validator.
Data is graciously provided by:
- [International Organization for Standardization](https://www.iso.org/iso-4217-currency-codes.html)
- [Currency Code Services ISO 4217 Maintenance Agency](https://www.currency-iso.org)
## Usage:
```
package main
func main() {
// Validation of codes.
ok := currency.Valid("ABC")
if !ok {
// whatever you need.
}
// easy to get the values
fmt.Println(currency.USD.Code())
// Output: USD
fmt.Println(currency.USD.MinorUnit())
// Output: 2
}
```