From a46edc6d2bc39367e6f2b85d90169aa131b3f65b Mon Sep 17 00:00:00 2001 From: Maksim Syomochkin Date: Fri, 17 Jan 2020 13:21:50 +0300 Subject: [PATCH] Update README --- README.md | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8382e84..ca32d3c 100644 --- a/README.md +++ b/README.md @@ -1 +1,25 @@ -# goxirr \ No newline at end of file +# goxirr +[![GoDoc](https://godoc.org/github.com/maksim77/goxirr?status.svg)](https://godoc.org/github.com/maksim77/goxirr) + +Goxirr is a simple implementation of a function for calculating the Internal Rate of Return for irregular cash flow (XIRR). + +## Example + +```go +import "time" + +import "github.com/maksim77/goxirr" + +firstDate := time.Date(2019, time.January, 1, 0, 0, 0, 0, time.UTC) +t1 := goxirr.Transaction{ + Date: firstDate, + Cash: -100, +} +t2 := goxirr.Transaction{ + Date: firstDate.Add(time.Hour * 24 * 365), + Cash: 112, +} + +tas := goxirr.Transactions{t1, t2} +fmt.Println(goxirr.Xirr(tas)) +``` \ No newline at end of file