Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/fedragon/goney

Represent monetary amounts in Go
https://github.com/fedragon/goney

golang money

Last synced: 1 day ago
JSON representation

Represent monetary amounts in Go

Awesome Lists containing this project

README

        

# goney

[![Build Status](https://travis-ci.org/fedragon/goney.svg?branch=master)](https://travis-ci.org/fedragon/goney)

Represents monetary amounts in Go with arbitrary-precision arithmetic on their amounts.

## Usage

```
package main

import (
"fmt"
"github.com/fedragon/goney"
)

func main () {
a := goney.FromFloat(goney.EUR, 1.23)

// Ignoring errors to keep the example concise:
// don't do this at home!
b, _ := goney.FromString("EUR 3.45")
c, _ := a.Add(b)

fmt.Println(c)
}
```