DEV Community

Nanda Safiq Alfiansyah
Nanda Safiq Alfiansyah

Posted on

I Make Golang library gocurrency

Image description

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")

Top comments (0)