Home

Awesome

decimal

go decimal package suitable for financial and monetary calculations

Build Status

Installation

go get github.com/dimdin/decimal

Documentation

Documentation and usage examples

Usage

import "github.com/dimdin/decimal"

    var x, y decimal.Dec
    x.SetString("100")
    y.SetString("3")
    x.Div(&x, &y, 2)
    fmt.Println(x)

Output:

33.33

Features

License

Use of this source code is governed by BSD 2-clause license that can be found in the LICENSE file.