The package golang.org/x/text/currency
is designed to handle currency standard printing implementation.
It provides all the most common currencies via a bunch of const currency.Unit
A currency.Unit
is a struct to an uint index
They refers to some data located under internal
folder.
I want to add support for a new currency. How do I proceed ?
Considering the Currency Unit represents ISO_4217, and seems fairly complete, you can't extend it directly.
You would need to go:
Rhymond/go-money
, which could be more completethrasher-/gocryptotrader/currency
, where new currencies can be extended through a json config file.init()
.