To format or convert back currency with currencyCode and locale, you can use the FormatCurrency and ParseCurrency functions with the appropriate parameters as shown in the table above.
Installation
To use the latest stable version:
go get github.com/nandasafiqalfiansyah/gocurrency@v1.1.0
Example
formattedUsd, err := gocurrency.FormatCurrency(123456789, "USD", "en_US")
decodedUsd, err := gocurrency.ParseCurrency(formattedUsd, "USD")
The above is the detailed content of I Make Golang library. For more information, please follow other related articles on the PHP Chinese website!