Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/fedragon/goney
- Owner: fedragon
- License: mit
- Created: 2019-11-10T20:24:13.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2019-11-18T20:03:45.000Z (about 5 years ago)
- Last Synced: 2024-12-17T22:07:21.740Z (8 days ago)
- Topics: golang, money
- Language: Go
- Homepage:
- Size: 20.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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 mainimport (
"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)
}
```