/daycount

Go module for financial day counting supporting various conventions

Primary LanguageGoMIT LicenseMIT

Daycount

Go Reference Build Status GolangCI Lint

Description

Package daycount provides daycounting methods.

Installation

go get -u github.com/edgelaboratories/daycount

Example

package main

import (
	"fmt"
	"log"

	"github.com/edgelaboratories/daycount"
)

func main() {
	from := date.New(2018, time.January, 1)
	to := date.New(2018, time.July, 31)
	yf := daycount.YearFraction(from, to, daycount.ActualActual)
	fmt.Printf("year fraction between the two dates is %0.2f\n", yf)
}